I'm using CakePHP and retrieve user info, make a calculation, and then I'd like to add that calculation into the array per user
After looking up a user, this is the structure of the array
print_r($user_info);
Array
(
[0] => Array
(
[User] => Array
(
[id] => 1
[email] => [email protected]
[website] => www.admin.com
)
)
)
Now I'm trying to add a 'num_payments' key for this particular user in a loop
array_push($user_info[$i]['User'],array('num_payments' => $customer_payments[$i]['num_payments']));
Here's the resulting array
Array
(
[0] => Array
(
[User] => Array
(
[id] => 1
[email] => [email protected]
[website] => www.admin.com
[0] => Array
(
[num_payments] => 1
)
)
)
)
How can I get it into this structure?
Array
(
[0] => Array
(
[User] => Array
(
[id] => 1
[email] => [email protected]
[website] => www.admin.com
[num_payments] => 1
)
)
)