++++如何将中英文混合字符串分割成单位数组如
$str='中a英b文c...';变成array('中','a','英','b','文','c','.','.','.');谁帮大忙,立等赠分

解决方案 »

  1.   

    <?php
    $str='中a英b文c...'; 
    preg_match_all("/[一-龥a-zA-Z0-9]/u",$str,$a);
    print_r($a);
    ?>
    这个utf-8编码测试通过
    Array
    (
        [0] => Array
            (
                [0] => 中
                [1] => a
                [2] => 英
                [3] => b
                [4] => 文
                [5] => c
            ))
      

  2.   

    $str = '中a英b文c...';
    preg_match_all('/[\x80-\xff]+|./', $str, $r);
    print_r($r[0]);