I have two PHP variables, both strings:
$friendslist = \"2323443,7245,284683,345123,8456234,95432\"
$id = \"10288272\";
The structure of the t
You are getting this error because you have not declared the $frienduserarray
as array any where in your code. Just declare it
$frienduserarray=array();
before the for
loop. After that your code should look like
$friendarray = explode(",", $friendslist);
$frienduserarray=array();
for ($n = 0; $n < count($friendarray); $n++) {
$friendidpush = "('".$id."','".$friendarray[$n]."'),";
array_push($frienduserarray, $friendidpush);
}