首页 > IT.IT > 【php】substr_count()函数

【php】substr_count()函数

2007年5月28日  如果本文对您有帮助,请留下您宝贵的足印!==>

昨天想统计一下tianya帖子的回复数,就想统计一下一段字符中某段字符出现的次数,就百度了一下下,当然找到了这个函数拉~~~substr_count()
官方说明:http://cn.php.net/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://newsn.net, 谢谢!
我的淘宝小店:http://68zz.com
我的Sina圈子:http://q.blog.sina.com.cn/pctalk


作者: 苏南 分类: IT.IT 标签:
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.