Look at the following code and see how the index reassigned.
<?php
$first_array = array(1, 2, 3, 4, 5, 6);
$second_array = array(10, 9, 7, 3, 5);
$new_array = array_merge($first_array, $second_array);
echo '<pre>';
print_r($new_array);
echo '</pre>';
/*
OUTPUT
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
[5] => 6
[6] => 10
[7] => 9
[8] => 7
[9] => 3
[10] => 5
)
*/
?>
No comments:
Post a Comment