Home > Backend Development > PHP Tutorial > PHP扩展开发(五)

PHP扩展开发(五)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 12:29:00
Original
916 people have browsed it

PHP扩展开发(5)

1. 定义

 

//定义PHP常量
REGISTER_STRINGL_CONSTANT("SIMPLE_VERSION", PHP_SIMPLE_VERSION, sizeof(PHP_SIMPLE_VERSION) - 1, CONST_PERSISTENT | CONST_CS);

 

 

2. 读取

 

zval *app_path;
MAKE_STD_ZVAL(app_path);
zend_get_constant("APP_PATH", strlen("APP_PATH"), app_path TSRMLS_CC);
RETURN_STRINGL(Z_STRVAL_P(app_path), Z_STRLEN_P(app_path), 1);
efree(app_path);

 

要先给app_path初始化一个空间,然后再释放。 

Related labels:
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
Latest Issues
access path
From 1970-01-01 08:00:00
0
0
0
Static resource path usage
From 1970-01-01 08:00:00
0
0
0
objective-c - header search path
From 1970-01-01 08:00:00
0
0
0
javascript - vue src path problem
From 1970-01-01 08:00:00
0
0
0
php move_uploaded_file() path parameter usage
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template