Ich habe Array, die eine Punktzahl und ID, die aus anderen Funktionen berechnet, und ich habe Benutzerinformationen, die aus der DB versucht.Push zu einem mehrdimensionalen Array in PHP
In beiden Array-IDs sind die gleichen Wie kann ich sie auf ein Array schieben?
Score Array
Array
(
[0] => Array
(
[id] => 85
[total_cnt] => 2006
)
[1] => Array
(
[id] => 86
[total_cnt] => 1014
)
[2] => Array
(
[id] => 92
[total_cnt] => 6
)
[3] => Array
(
[id] => 93
[total_cnt] => 6
)
)
Benutzer Info
Array
(
[0] => Array
(
[id] => 52
[user_phone] => 00000000
[user_email] => [email protected]
[user_name] => yahoo
[user_picture] =>FG6K7Z3XTc.Pic.jpg
[user_post_hour] => 24
[user_is_block] => 1
[user_reg_date] => 2017-05-16 13:52:35
)
[1] => Array
(
[id] => 78
[user_phone] => 000000001
[user_email] => [email protected]
[user_name] => google
[user_picture] =>XqWKSDVci.Pic.jpg
[user_post_hour] => 24
[user_is_block] => 0
[user_reg_date] => 2017-05-16 13:52:35
)
)
My Desire Ausgabe
Array
(
[0] => Array
(
[id] => 86 <--Same ID in both arrays
[user_phone] => 00000000
[user_email] => [email protected]
[user_name] => yahoo
[user_picture] =>FG6K7Z3XTc.Pic.jpg
[user_post_hour] => 24
[user_is_block] => 1
[user_reg_date] => 2017-05-16 13:52:35
[total_cnt] => 1014 <-- first array field added
)
Ich möchte eine optim ized Code und ich werde nicht Schleife verwendet für diesen
Danke für Ihre Hilfe
Siehe das Update, –