-
- $str = 'http://bbs.it-home.org phper,php learning_php technology_php website construction_php programmers focus on php technology research and learning_characters appear Times';
- echo substr_count($str,'php').'
';
- echo substr_count($str,'h').'
';
- echo substr_count($ str,'php programmer');
- ?>
Copy the code
Output results:
5
3
1
Related links:
- php string search function (strrpos and strchr)
- php string search function strstr(), strrchr() examples
|