PHP Convert Array em objeto JSON
$myArr = array("apple", "banana", "mango", "jackfruit");
$toJSON = json_encode($myArr);
echo $toJSON;
Lazy Loris
$myArr = array("apple", "banana", "mango", "jackfruit");
$toJSON = json_encode($myArr);
echo $toJSON;
[
"db" => [
"table" => "report_data",
"field" => "id_report"
],
"fields" => [
[
[
"city" => "name"
],
"id_city",
"city"
],
[
[
"federal_subject_name" => "name"
],
"id_region",
"region"
],
[
[
"area" => "name"
],
"id_area",
"area"
],
[
[
"inn" => "inn",
"owner" => "name"
],
"id_owner",
"owner"
]
]
];