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

接收PHP函数参数

WBOY
WBOYOriginal
2016-06-20 12:40:12930browse

        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

说明:

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

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

Statement:
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