字符串转换成数组

$str="1234567"
如何转变成一个数组
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
[5] => 6
[6] => 7
)

---------------------------------------------------------------

$array=str_split($str);
---------------------------------------------------------------

1   
2$str="1234567";   
3print_r(preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY));   
Published At
Categories with Web编程
comments powered by Disqus