I'm getting the "Warning: Illegal string offset" error when trying to extract data from an array I have converted from JSON.
Now I gather this happens when the index you are using does not exist, which puzzles me because it does exist and works fine when I wish to access the array value directly.
My JSON is decoded into the array using the code $clean = json_decode($json_output, true); and if I use echo $clean['text'] the string value of 'text' is displayed fine.
However when I attempt this piece of code I get the error:
foreach ($clean as $key => $list){
$output .= $list['text'];}
I have a feeling I am making a silly mistake somewhere!
print_r($clean);