可以使用str_split()函数将一个字符串转换为数组。该函数将字符串按照指定的长度拆分为一个数组。例如:
$str = "Hello World";
$arr = str_split($str);
print_r($arr);
输出结果为:
Array
(
[0] => H
[1] => e
[2] => l
[3] => l
[4] => o
[5] =>
[6] => W
[7] => o
[8] => r
[9] => l
[10] => d
)