str*_*ade 12
function ascii_to_dec($str)
{
for ($i = 0, $j = strlen($str); $i < $j; $i++) {
$dec_array[] = ord($str{$i});
}
return $dec_array;
}
Run Code Online (Sandbox Code Playgroud)
示例用法:
$ascii ="\t";
print_r( ascii_to_dec($ascii));
Run Code Online (Sandbox Code Playgroud)
返回一个数组
Array
(
[0] => 9
)
Run Code Online (Sandbox Code Playgroud)