I have a value from database in json_encode format.
[["Size: 10x24 (+150)","Backing: Black","Lines: 1","Border: No Border","Border Color: ","Flashing: No Thanks","Outdoor: No","Vertical: No","contoured cut: No","qty: 1","Text 1: Custom","Line 1: Red","Font 1: Arial"]]
I want to display it's json_decode
format in table.
$options = json_decode($options, true);
Then I am trying to put it in foreach loop:
foreach ($options as $value)
{
echo $value, "
";
};
and the output is just Array
.
echo('<pre>'); print_r($json); echo('</pre>');
print_r()
returns:
Array
(
[0] => Array
(
[0] => Size: 10x24 (+150)
[1] => Backing: Black
[2] => Lines: 1
[3] => Border: No Border
[4] => Border Color:
[5] => Flashing: No Thanks
[6] => Outdoor: No
[7] => Vertical: No
[8] => contoured cut: No
[9] => qty: 1
[10] => Text 1: Custom
[11] => Line 1: Red
[12] => Font 1: Arial
)
)
But it does not look good. which is the better and easy way to echo json_decode data in php?