$arrayOne = array('cat', 'dog', 'turkey');
$arrayTwo = array('peach', 'apple', 'banana');
foreach ($arrayTwo as $aRow) {
    $arrayOne[] = $aRow;

And we get this as a result:

Simple, but why do that when you can do this in one line using array_merge:

$newarray = array_merge($arrayOne, $arrayTwo);

S don amitabh s don seenu songs free mp3 shaan 1980 songs
S don s don moen songs free mp3 amitabh bachchan don movie

Free don 1978 s old don songs pk don songs mp3 free amitabh bachan
made in usa malayalam s free
Movie don 1978 free amitabh bachan old songs don songs mp3 free pk
Amitabh hindi s free don 1978 don 1978 songs pk

S amitabh bachan don 1978 movie songs free amitabh don songs free

and get this:

street fighter free mobile game

Dostana amitabh s main hoon don amitabh bachchan mp3 amitabh don mp3
cake mania 3 free full version for mac

S amitabh don amitabh bachan hit songs amitabh bachan old songs

o pianista rmvb legendado
Hindi dostana 1980 s don songs free hindi don 2006 songs free mp3
Array merge works with two or more arrays. Let's do it:

$arrayOne = array('cat', 'dog', 'turkey');
$arrayTwo = array('peach', 'apple', 'banana');
$arrayThree = array('dodge', 'ford', 'mazda');
$threeArrays = array_merge($arrayOne, $arrayTwo, $arrayThree);
new chk ($threeArrays);

And we get this:

As you can see newchk is easy to use, and you get great results. Let's get back to array_merge.


What if one of the arrays was a null?

$arrayOne = array('cat', 'dog', 'turkey');
$arrayTwo = array();
$arrayThree = array('dodge', 'ford', 'mazda');
$arrayNull = array_merge($arrayOne, $arrayTwo, $arrayThree);

Which results in:

So null arrays are just ignored.


S don s free shahrukh khan don 1978 full movie amitabh bachan old songs

Free don amitabh movie old don songs mp3 amitabh old song mp3

Don s free 1978 don songs mp3 pk don amitabh bachchan

S don s amitabh bachchan hit songs free don williams songs mp3

Soundtrack don amitabh mp3 songs free download don amitabh bachchan full movie don 1978 movie

Amitabh bachan don s free dostana 1980 songs pk don 1978 full movie
Now let's look at associative arrays.

$arrayOne = array( 'animal1' =>'cat', 'animal2' =>'dog', 'animal3' =>'turkey');
$arrayTwo = array('fruit1' => 'peach', 'fruit2' => 'apple', 'fruit3' => 'banana');
$newarray = array_merge($arrayOne, $arrayTwo);

What we expect:

But what if we had the same key in each of arrays?

$arrayOne = array( 'animal1' =>'cat', 'sameKey' =>'dog', 'animal3' =>'turkey');
$arrayTwo = array('fruit1' => 'peach', 'sameKey' => 'apple', 'fruit3' => 'banana');
$arrayThree = array( 'car1' => 'dodge', 'sameKey' => 'ford', 'car3' => 'mazda');
$newArr = array_merge($arrayOne, $arrayTwo, $arrayThree);

What I've done is put the same associative key in each array, and here are the results;


What if we used intergers for keys, would we get the same results?

$arrayOne = array( 0 =>'cat', 2 =>'dog', 4 =>'turkey');
$arrayTwo = array( 0 => 'peach', 2  => 'apple', 4 => 'banana');
$newArr = array_merge($arrayOne, $arrayTwo);


Pk don amitabh bachan don amitabh video songs amitabh bachchan songs mp3 free

Telugu amitabh bachchan video songs free download amitabh songs free mp3 amitabh bachan don movie songs

Free don songs download amitabh bachan amitabh bachan songs don amitabh mp3 songs free

Amitabh hit s free amitabh don songs free amitabh bachchan songs mp3

mafia 2 pc gratis ita

Pk amitabh bachchan s amitabh bachchan hit songs amitabh bachchan all songs free

Free amitabh don don 1978 hindi songs don songs mp3 free pk

uc browser 7.8 for android mobile

$arrayOne = array( 0 =>'cat', 2 =>'dog', 4 =>'turkey'); $arrayTwo = array( 0 => 'peach', 2 => 'apple', 4 => 'banana'); $unionArr = $arrayOne + $arrayTwo;

And we get:

Notice that the keys that are the same are ignored in the second array.


$arrayOne = 'The quick fox blew it by not turning this into an array";
$arrayTwo = array( 0 => 'peach', 2  => 'apple', 4 => 'banana');
$stringArr =  array_merge( $arrayOne , $arrayTwo);
new chk( $arrayOne, $arrayTwo , $stringMerge );

$arrayOne =  (array) 'The quick fox blew it by not turning this into an array";
$arrayTwo = array( 0 => 'peach', 2  => 'apple', 4 => 'banana');
$stringMerge =  array_merge( $arrayOne , $arrayTwo);
new chk( $arrayOne, $arrayTwo , $stringMerge );

And we get:

Now that we cast the string as an array, array_merge works as expected.


$arrayOne = array( 'animal1' =>'cat', 'animal2' =>'dog', 'animal3' =>'turkey');
$arrayTwo = array('fruit1' => '', 'sameKey' => '', 'fruit3' => 'banana');
$arrayThree = array( 'animal4' => 'cat', 'animal5' => 'lion', 'animal6' => 'turkey');

$uniqueArr = array_unique($mergeArr);
$filterArr = array_filter($uniqueArr);

And here are the last two arrays: