執行 ❯
獲取您
自己的 PHP
伺服器
×
更改方向
更改主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <body> <?php $str = "PHP is pretty fun!!"; $strArray = count_chars($str,1); foreach ($strArray as $key=>$value) { echo "The character <b>'".chr($key)."'</b> was found $value time(s)<br>"; } ?> </body> </html>
找到了 3 個字元
' '
找到了 2 個字元
'!'
找到了 1 個字元
'H'
找到了 2 個字元
'P'
找到了 1 個字元
'e'
找到了 1 個字元
'f'
找到了 1 個字元
'i'
找到了 1 個字元
'n'
找到了 1 個字元
'p'
找到了 1 個字元
'r'
找到了 1 個字元
's'
找到了 2 個字元
't'
找到了 1 個字元
'u'
找到了 1 個字元
'y'