电脑学网(Xue5.CoM)
昨天想统计一下tianya帖子的回复数,就想统计一下一段字符中某段字符出现的次数,就百度了一下下,当然找到了这个函数拉~~~substr_count()
官方说明:http://http://www.zjjv.com///manual/zh/function.substr-count.php
hihi,here we go~~~~~~~~~
说明:
int substr_count ( string $haystack, string
$needle [, int $offset [, int $length]] )
substr_count() returns the number of times the
needle substring occurs in the haystack string. Please note that
needle is case sensitive.
贴个例子比什么都说明问题。见下:
文章整理:学网 http://http://www.zjjv.com// (本站)
0
0