WordPress企业主题定制/开发/优化

php substr_count计算字符串出现次数

首页 » PHP » php substr_count计算字符串出现次数

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

?>

分类与标签:

PHP

,

相关项目

  • WordPress外贸企业主题

  • 最近更新

  • 热门标签