foreach ($vbulletin->GPC['favoriteteam'] as $team){ $teams .= "$team,";}$teams = $teams.",0";$teams = str_replace(",,", ",", $teams);$teams = str_replace(",0", "", $teams);