php下关于字符串与数组的相互转换的函数

    public static function string2array($tags)
    {
        return preg_split('/\s*,\s*/',trim($tags),-1,PREG_SPLIT_NO_EMPTY);
    }
    
    public static function array2string($tags)

 {
        return implode(',', $tags);
    }

posted @ 2014-05-08 10:00  NintendoBoy  阅读(184)  评论(0编辑  收藏  举报