Can some one explain me what is going on in these 3 functions please?
public function normalizeTags($attribute,$params)
{
$this->tag=Tag::array2string(array_unique(Tag::string2array($this->tag)));
}
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);
}
Splitting an array of tags, filtering duplicate records and returning it to string.
string”