/** +---------------------------------------------------------- * 将一个字符串转换成数组,支持中文 +---------------------------------------------------------- * @param string $string 待转换成数组的字符串 +---------------------------------------------------------- * @return string 转换后的数组 +---------------------------------------------------------- */function strToArray($string) { $strlen = mb_strlen($string); while ($strlen) { $array[] = mb_substr($string, 0, 1, "utf8"); $string = mb_substr($string, 1, $strlen, "utf8"); $strlen = mb_strlen($string); } return $array;}