Convert JSON object to PHP array or render array as PHP code
require 'src.php';
$json = '{
"hello":"world",
"properties":{
"url":"https://github.com/matejbukovsky/php-json-to-array",
"convert":true
},
"test": ["first", "second", 0]
}';
echo getCode(json_decode($json, TRUE));
[
"hello" => "world",
"properties" => [
"url" => "https://github.com/matejbukovsky/php-json-to-array",
"convert" => TRUE,
],
"test" => [
0 => "first",
1 => "secons",
2 => 0,
],
];