Im receiving the following variable sent as a json array from javascript: $_REQUEST['fb_friend_uid']
I then decode the array and then do a var_dump
$string = json_encode($_REQUEST['fb_friend_uid']);
$result = json_decode($string, true);
var_dump($result);
The var_dump shows me the following
array (size=360)
0 =>
array (size=1)
'id' => string '263901486' (length=9)
1 =>
array (size=1)
'id' => string '502533736' (length=9)
2 =>
array (size=1)
'id' => string '506526230' (length=9)
3 =>
array (size=1)
'id' => string '507245473' (length=9)
etc..
How would I go about saving all values from 'id' into one new $var_string ? - formatted like: "263901486, 502533736, 506526230"
Objective is to use the string in an sql query like so:
SELECT * FROM vote WHERE
vote_fb_uid IN ($var_string)