How does PHP remove quotation marks on both sides of the array and return the array

as shown in the figure, how to get to the quotation marks on both sides of the queue and return the data in array format

Mar.02,2021

if my eyes read it correctly, it should be a json string with extra spaces. According to my thinking, it should be like this.

// json_str
$str = '{"aa":"  [[123123,123123123],[123123123,123123],[123,123123]]"}';
// 
$arr = json_decode($str,true);
// 
$data = json_decode(trim($arr['aa']),true);
print_r($data);

trim ($str,'[]')


you may have to use regular processing, extract all the characters like [xxxx,yyyyy] through json_decode, and then push into a newly declared array.


are you missing a json_decode??


$str ='{"aa": "[[123123 str 123123123], [123123123 123123], [123123123]]}';
/ / first transfer yard farmhouse
$arr = json_decode ($str,true);

print_r (trim ($arr ['aa']));

Menu