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);
    }

原文地址:https://www.cnblogs.com/superzlc/p/3715514.html