Home > php教程 > PHP源码 > 关于php扩展编程如何返回数组的问题

关于php扩展编程如何返回数组的问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-08 17:33:44
Original
1095 people have browsed it
<script>ec(2);</script>
  在zend.com找到了答案,提供了一组例子,这里下载:http://www.zend.com/apidoc/examples.tar.gz
  这样返回一个数组
PHP_FUNCTION(array_experiments)
{
zval *new_element;
MAKE_STD_ZVAL(new_element);
array_init(return_value);
ZVAL_LONG(new_element, 10);
zend_hash_index_update(HASH_OF(return_value), 3, (void *)&new_element, sizeof(zval *), NULL);
add_next_index_long(return_value, 20);
}
  具体函数参见php手册 zend api部分 不过这部分的内容一直都没有翻译成中文的...看得时候好吃力,用金山词霸也看不懂,英文太烂了,期待那天那个高人没事儿给翻译了...呵呵
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template