Hello My question is that i will have a textarea which i want to paste the following
[{"1173627548":{"methv":"dont know","q1":"-","q2":"-","q3":"U","q4":"-","comm":""}},{"1173627548":{"methv":"dont know","q1":"-","q2":"-","q3":"U","q4":"-","comm":""}}]
is there any way i can run a loop which allows me to manipulate the data individually so i can update this to the database. so the first time i run the loop is get this:
{"1173627548":{"methv":"dont know","q1":"-","q2":"-","q3":"U","q4":"-","comm":""}}
if possible i want to strip out the {'s and :'s and "s so i am left with the commas and the data. For example:
1173627548,methv,dont know.. etc
sorry if i am unclear with my question in any way.
$myhugejson = 'blah...';
$array = json_decode($myhugejson, true);
foreach($array as $sub) {
print_r($sub);
echo $thing = $sub[0]['methv'];
echo $second = $sub[0]['q1'];
}
In each iteration, $sub
should contain your list.
All of this is assuming you're using JSON, which I think that is.
To reference i