2010-11-19 112 views

回答

1

你的意思是字符串函數嗎?

$string = "texttexttext"; 
$bytes = array(); 
for($i = 0; $i < strlen($string); $i++){ 
    $bytes[] = ord($string[$i]); 
} 
print_r($bytes); 

--Output--

Array 
(
[0] => 116 
[1] => 101 
[2] => 120 
[3] => 116 
[4] => 116 
[5] => 101 
[6] => 120 
[7] => 116 
[8] => 116 
[9] => 101 
[10] => 120 
[11] => 116 
)