hrefspace's Archiver
论坛
›
PHP
› 应用substr_count()函数检索子字符串在字符串中出现的次数
_only
发表于 2023-1-3 11:25:08
应用substr_count()函数检索子字符串在字符串中出现的次数
应用substr_count()函数检索子字符串在字符串中出现的次数的应用实例
<?php
$str = "PHP自学教程、JavaWeb自学教程、Java自学教程、VB自学教程"; //定义字符串
echo substr_count($str,"自学教程"); //输出检索的结果
?>
执行结果:
4
nihaolai
发表于 2023-2-17 21:22:31
好好好好好好好好好好好好好好好好好顶
页:
[1]
查看完整版本:
应用substr_count()函数检索子字符串在字符串中出现的次数