在PHP中,可以使用str_split()
函数将字符串转换为数组。示例如下:
$string = "Hello World";
$array = str_split($string);
print_r($array);
输出结果为:
Array
(
[0] => H
[1] => e
[2] => l
[3] => l
[4] => o
[5] =>
[6] => W
[7] => o
[8] => r
[9] => l
[10] => d
)
辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读: php搜索结果分页怎么实现