Json to PHP associative array
<?php
## JSON : an object with attribute with key name and values as value
$json = '
{
"key": "value",
"key2": "value2"
}
';
$assoc = true;
$result = json_decode ($json, $assoc);
?>
##$result (php code):
<?php
array (
'key' => 'value',
'key2' => 'value2',
);
?>
Comments