运行 ❯
获取您
自己
的 PHP 服务器
×
更改方向
更改主题,深色/浅色
转到空间
<!DOCTYPE html> <html> <body> <?php $str = "This is nice"; echo strlen($str)."<br>"; // Using strlen() to return the string length echo substr_count($str,"is")."<br>"; // The number of times "is" occurs in the string echo substr_count($str,"is",2)."<br>"; // The string is now reduced to "is is nice" echo substr_count($str,"is",3)."<br>"; // The string is now reduced to "s is nice" echo substr_count($str,"is",3,3)."<br>"; // The string is now reduced to "s i" ?> </body> </html>
12
2
2
1
0