PHP Array Exercises : Merge two arrays
Write a PHP program to merge (by index) the following two arrays.
Sample arrays :
$array1 = array(array(77, 87), array(23, 45));
$array2 = array("w3resource", "com");
Sample Solution:
PHP Code:
Output:
<pre>Array ( [0] => Array ( [0] => w3resource [1] => 77 [2] => 87 ) [1] => Array ( [0] => com [1] => 23 [2] => 45 ) )
Flowchart:

PHP Code Editor:
Contribute your code and comments through Disqus.
Previous: Write a PHP program to sort an array of positive integers using the Bead-Sort Algorithm.
Next: Write a PHP function to change the specified array's all values to upper or lower case.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics