執行 ❯
獲取您
自己的 PHP
伺服器
×
更改方向
更改主題,深色/淺色
前往 Spaces
<!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