Explode() function to break up string into 2 subsequent arrays php -
i'm trying split $param variable below in format
listofitems//listofitems//listofitems... where each item in format
event,event,event,event... into individual events (numbers) passed checkuseritems function. @ moment i'm getting first listofitems (1,4,9,7,5,8) , 149758 echo functions. why other 2 lists being ignored?
$param= "1,4,9,7,5,8//5,8,9,6,4,2//8"; $item = explode("//",$param); $allitemslength = count($item); $alluseritems["list"] = array(); ($x = 0; $x < $allitemslength; $x++) { echo($item[$x]); $id = explode(",",$item[$x]); $arrlength = count($id); $response["item"] = array(); for($x = 0; $x < $arrlength; $x++) { echo ($id[$x]); // $result= $db->checkuseritems($id[$x]); } }
Comments
Post a Comment