php substr_count计算字符串出现次数

2009年12月2日 | 九创主题

php substr_count计算字符串出现次数

substr_count
(PHP4 >= 4.0RC2)

substr_count ---  计算字符串的出现次数

语法 : int substr_count (string haystrack, string needle)

说明 :

substr_count( )传回参数 needle在 haystrack中出现的次数。

Example :

<?php

print substr_count("This is a test", "is");    // prints out 2

?>


转载文章请注明转载自:九创主题

标签: ,

留下回复

您必须登录才能发表评论。