Home  >  Article  >  Backend Development  >  php字符串查找函数zend_memnstr

php字符串查找函数zend_memnstr

WBOY
WBOYOriginal
2016-06-23 13:31:40917browse

Zend/zend_operators.h:
static inline char * zend_memnstr(char *haystack, char *needle, int needle_len, char *end){     //字符首指针     char *p = haystack;     //最后一个字符     char ne = needle[needle_len-1];      //减小查询范围,判断needle_len应该小于end还算比较巧妙哦     end -= needle_len;     while (p   

php函数strpos、explode都用到了此函数,具体代码可以查看:ext/standard/string.c

版权声明:本文为博主原创文章,未经博主允许不得转载。

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