Q:

JSON element save to variable

I have a JSON in a URL, that return this: 
[{"id":"aabbcc","name":"aabbcc"}]

$json = file_get_contents('http:localhost/myapp/aabbcc/config'):
$config = json_decode($json, true);

I want save the parameter 'id' in a variable: 
This is correct? 
$id = $config['id'];

A:

Var $config will be an array with single associated array.
You should get first assoc. array and then id key of it:
$id = $config[0]['id'];

