php去重 逗号分隔的字符串

$newstr = implode(',',array_unique(explode(',',$newstr)));//去重