$slct = $_POST['txtcheck']; $total_slct = sizeof($slct); for ($i=0; $i < $total_slct; $i++){ $str2 .= $slct[$i].","; } $str1 = mysql_result(q("SELECT favorites from __users where user_id = '".s(user_id)."'"),0); $str2 = substr($str2,0,-1); $z = explode(",",$str1); //$z[0]; function fav_replace($str,$val,$mode) { if($mode==1) { $r = str_replace($str,$val,$r); } else { $r = $str; } } $g1 = ""; while (1==1){ }