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

And we get this as a result:

Debugger adobe flash player 10.3 free chrome adobe flash player 10.3 free chrome adobe flash player 10.3 apk

Debugger ti 83 flash debugger free adobe flash player debugger firefox flash player debugger version

Firefox flash 10.3 download apk flash player debugger version 10.2.0 free flash builder debug plugin

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

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

and get this:

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.

NULL ARRAYS

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.

Mac flash player 10.3 windows 7 flash 10.3 for apk flash player debug mac

Free flash player 10.3 beta mac flash 10.3 mac flash builder debug

Debugger flash debugger for firefox free adobe flash player 10.3 apk flash player debug 64 bit

Apk flash 10.3 apk adobe flash 10.3 apk file flash 10.3 apk

Chrome flash 10.3 windows flash player debugger chrome flash player 11 debugger version
ASSOCIATIVE KEYS

Now let's look at associative arrays.

Mac adobe flash player 10.3 for adobe flash 9 debugger flash player 10.3 free for vista
Failed flash builder debug download macromedia flash 10.3 flash player 10.3 cnet

Version flash player 10.3 free download for mobile adobe flash 10.3 configuration failed adobe flash 10.3 configuration failed

Mac adobe flash player 10.3 free chrome adobe flash player 10.3 mac free flash player 10.3 for 2.2
For flash player 10.3 download cnet flash player debugger chrome adobe flash player 10.3 chrome
123 copy dvd platinum hd
$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;

NUMERIC KEYS

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

10.3 adobe flash 10.3 windows flash 10.3 free adobe flash debugger for chrome

Apk adobe flash player 10.3 mac flash player debugger version adobe flash debugger for chrome

Apk adobe flash 10.3 download apk flash player debug version flash builder debug plugin

Free google chrome flash debugger download flash player 10.3 windows flash player 10.3 for

Bit flash player debugger free adobe flash player debugger firefox adobe flash player 10.3 windows 7
Chrome flash plugin debug version flash builder debugger version adobe flash player debugger firefox
Adobe adobe flash builder 4 debugger adobe flash debugger version adobe flash 10.3 apk file
Version flash player debug version adobe flash player 10.3 apk adobe flash 10 debugger
$arrayOne = array( 0 =>'cat', 2 =>'dog', 4 =>'turkey'); $arrayTwo = array( 0 => 'peach', 2 => 'apple', 4 => 'banana'); $newArr = array_merge($arrayOne, $arrayTwo);

ARRAY UNION

$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.

STRINGS

$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.

CLEANING ARRAYS

$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: