Ok guys, I've got this from CakePHP:
array(
(int) 0 => array(
'Worker' => array(
'id' => '1',
'username' => 'davorlozic',
'first_name' => 'Davor',
'last_name' => 'Lozic',
'active' => true,
'created' => '2012-05-12 10:39:05',
'modified' => '2012-05-12 10:39:05'
)
),
(int) 1 => array(
'Worker' => array(
'id' => '2',
'username' => 'markomarkovic',
'first_name' => 'Marko',
'last_name' => 'Markovic',
'active' => true,
'created' => '2012-05-12 10:39:20',
'modified' => '2012-05-12 10:39:20'
)
So, when I encode it with JSON_ENCODE I get this:
BUT I NEED TO GET THIS: HOW? (this shape, not these data)
{
"success": true,
"Workers": [
{"id": 1, "name": 'Ed', "email": "ed@sencha.com"},
{"id": 2, "name": 'Tommy', "email": "tommy@sencha.com"}
]
}
Can I do something with the FIRST array? Some shifting or something? Thank you! :)