首页 >后端开发 >php教程 >php字符串查找函数zend_memnstr

php字符串查找函数zend_memnstr

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原创
2016-06-23 13:31:401015浏览

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   <p>php函数strpos、explode都用到了此函数,具体代码可以查看:ext/standard/string.c</p>  <p class="sycode">   </p><p>版权声明:本文为博主原创文章,未经博主允许不得转载。</p>   
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn