- json_decode: documentation ( source)
- print_r: documentation ( source)
- array_keys: documentation ( source)
<?php
$json_str = <<<TEXT
{
"Example": {
"ExampleOne": {
"rate": "0"
},
"ExampleTwo": {
"rate": "0"
},
"ExampleThree": {
"rate": "0"
}
}
}
TEXT;
$json = json_decode($json_str, true);
$keys = array_keys($json['Example']);
print_r($keys);