How I can merge n arrays in PHP. The number of arrays is determined by the number of users who want to extract some information.
I need to make something like this
$result = array_merge_recursive ($tweets0, $tweets1, $tweets2, $tweets3, $tweets4, $tweets5, ... n);
How could I solve it?
An example with 3 arrays
$tweets0
Array
(
[statuses] => Array
(
)
[search_metadata] => Array
(
[completed_in] => 0.021
[max_id] => 4.2466715126216E+17
[max_id_str] => 424667151262158848
[query] => from%3A%40nopiedra+AND+%23utpl
[refresh_url] => ?since_id=424667151262158848&q=from%3A%40nopiedra%20AND%20%23utpl&result_type=recent
[count] => 50
[since_id] => 0
[since_id_str] => 0
)
)
$tweets1
Array
(
[statuses] => Array
(
[0] => Array
(
[metadata] => Array
(
[result_type] => recent
[iso_language_code] => es
)
[created_at] => Fri Jan 17 18:07:56 +0000 2014
[id] => 4.2424169391194E+17
[id_str] => 424241693911941120
[text] => Alguna alma caritativa de la #utpl podrÃa ayudarme con las pregunta de Expresión oral que bestia ni contabilidad es tan complicada como esta
[source] => Twitter for Android
[truncated] =>
[in_reply_to_status_id] =>
[in_reply_to_status_id_str] =>
[in_reply_to_user_id] =>
[in_reply_to_user_id_str] =>
[in_reply_to_screen_name] =>
[user] => Array
(
[id] => 99147465
[id_str] => 99147465
[name] =>  Steve Cedeño
[screen_name] => stevecede
[location] =>
[description] => Barcelonista ,gusto del rock y en contra del regueton,adicto al Playstation 3... since 1982
[url] => https://t.co/Miwfx1QAu4
)
)
)
[search_metadata] => Array
(
[completed_in] => 0.015
[max_id] => 4.2424169391194E+17
[max_id_str] => 424241693911941120
[query] => from%3A%40stevecede+AND+%23utpl
[refresh_url] => ?since_id=424241693911941120&q=from%3A%40stevecede%20AND%20%23utpl&result_type=recent
[count] => 50
[since_id] => 0
[since_id_str] => 0
)
)
$tweets2
Array
(
[statuses] => Array
(
[0] => Array
(
[metadata] => Array
(
[result_type] => recent
[iso_language_code] => es
)
[created_at] => Sat Jan 18 16:14:56 +0000 2014
[id] => 4.2457564273929E+17
[id_str] => 424575642739290112
[text] => Hall del edificio #UGTI de la #UTPL congestionadÃsimo transite con cuidado... XD
[source] => TweetDeck
[truncated] =>
[in_reply_to_status_id] =>
[in_reply_to_status_id_str] =>
[in_reply_to_user_id] =>
[in_reply_to_user_id_str] =>
[in_reply_to_screen_name] =>
[user] => Array
(
[id] => 14938800
[id_str] => 14938800
[name] => Xavier Jaramillo
[screen_name] => xavito90
[location] => Loja
[description] => Estudiante de IngenierÃa en Sistemas... Del bombillo soy...!!!
[url] => http://t.co/SestnLJ58A
)
)
)
[search_metadata] => Array
(
[completed_in] => 0.017
[max_id] => 4.2457564273929E+17
[max_id_str] => 424575642739290112
[query] => from%3A%40xavito90+AND+%23utpl
[refresh_url] => ?since_id=424575642739290112&q=from%3A%40xavito90%20AND%20%23utpl&result_type=recent
[count] => 50
[since_id] => 0
[since_id_str] => 0
)
)
The result is
Array
(
[statuses] => Array
(
[0] => Array
(
[metadata] => Array
(
[result_type] => recent
[iso_language_code] => es
)
[created_at] => Fri Jan 17 18:07:56 +0000 2014
[id] => 4.2424169391194E+17
[id_str] => 424241693911941120
[text] => Alguna alma caritativa de la #utpl podrÃa ayudarme con las pregunta de Expresión oral que bestia ni contabilidad es tan complicada como esta
[source] => Twitter for Android
[truncated] =>
[in_reply_to_status_id] =>
[in_reply_to_status_id_str] =>
[in_reply_to_user_id] =>
[in_reply_to_user_id_str] =>
[in_reply_to_screen_name] =>
[user] => Array
(
[id] => 99147465
[id_str] => 99147465
[name] =>  Steve Cedeño
[screen_name] => stevecede
[location] =>
[description] => Barcelonista ,gusto del rock y en contra del regueton,adicto al Playstation 3... since 1982
[url] => https://t.co/Miwfx1QAu4
)
)
[1] => Array
(
[metadata] => Array
(
[result_type] => recent
[iso_language_code] => es
)
[created_at] => Sat Jan 18 16:14:56 +0000 2014
[id] => 4.2457564273929E+17
[id_str] => 424575642739290112
[text] => Hall del edificio #UGTI de la #UTPL congestionadÃsimo transite con cuidado... XD
[source] => TweetDeck
[truncated] =>
[in_reply_to_status_id] =>
[in_reply_to_status_id_str] =>
[in_reply_to_user_id] =>
[in_reply_to_user_id_str] =>
[in_reply_to_screen_name] =>
[user] => Array
(
[id] => 14938800
[id_str] => 14938800
[name] => Xavier Jaramillo
[screen_name] => xavito90
[location] => Loja
[description] => Estudiante de IngenierÃa en Sistemas... Del bombillo soy...!!!
[url] => http://t.co/SestnLJ58A
)
)
)
[search_metadata] => Array
(
[completed_in] => Array
(
[0] => 0.021
[1] => 0.015
[2] => 0.017
)
[max_id] => Array
(
[0] => 4.2466715126216E+17
[1] => 4.2424169391194E+17
[2] => 4.2457564273929E+17
)
[max_id_str] => Array
(
[0] => 424667151262158848
[1] => 424241693911941120
[2] => 424575642739290112
)
[query] => Array
(
[0] => from%3A%40nopiedra+AND+%23utpl
[1] => from%3A%40stevecede+AND+%23utpl
[2] => from%3A%40xavito90+AND+%23utpl
)
[refresh_url] => Array
(
[0] => ?since_id=424667151262158848&q=from%3A%40nopiedra%20AND%20%23utpl&result_type=recent
[1] => ?since_id=424241693911941120&q=from%3A%40stevecede%20AND%20%23utpl&result_type=recent
[2] => ?since_id=424575642739290112&q=from%3A%40xavito90%20AND%20%23utpl&result_type=recent
)
[count] => Array
(
[0] => 50
[1] => 50
[2] => 50
)
[since_id] => Array
(
[0] => 0
[1] => 0
[2] => 0
)
[since_id_str] => Array
(
[0] => 0
[1] => 0
[2] => 0
)
)
)
This result is achievement with array_merge_recursive($tweets0, $tweets1, $tweets2) But what can I do when I join more arrays, and do not know whose number
I appreciate your help