close
純數字和英文字母組合
$utf8Str = "I have 4 books and 2 magazines to check out. ";
var_dump(mb_check_encoding($utf8Str,'utf-8')); //輸出true
var_dump(mb_check_encoding($utf8Str,'gbk')); //輸出true
big5編碼的字符串
<?php
$str = '發68億給老家吃蟹腦遭寄生空姐劉晶晶劉香慈出嫁薄外套統一發票最美女騙子線上訂房人氣美食劉振南身亡高顏值記者陳妍希辣照';
var_dump(mb_check_encoding($str,'utf-8')); //輸出false
var_dump(mb_check_encoding($str,'big5')); //輸出true
?>
全站熱搜
留言列表