PHP字符串转数组函数:str_split。

示例:


$str='www.codesou.cn';
$arr=str_split($str);

输出:


array:13 [
  0 => "w"
  1 => "w"
  2 => "w"
  3 => "."
  4 => "0"
  5 => "2"
  6 => "4"
  7 => "0"
  8 => "5"
  9 => "."
  10 => "c"
  11 => "o"
  12 => "m"
]