Home > Backend Development > PHP Tutorial > 接收PHP函数参数

接收PHP函数参数

WBOY
Release: 2016-06-20 12:40:12
Original
926 people have browsed it

        char *arg = NULL;	int arg_len;	char *arg2 = NULL;	int arg2_len;        //arg参数值,arg_len参数长度	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &arg, &arg_len,&arg2, &arg2_len) == FAILURE) {		return;	}	php_printf("%s|%u|%s|%u", arg,arg_len,arg2, arg2_len);//调用php中函数printf
Copy after login

说明:

  • 参数个数一定是确定的。

  • ZEND_NUM_ARGS() TSRMLS_CC 生成为:(ht),tsrm_ls

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template