- print_r: documentation ( source)
- array_merge: documentation ( source)
- array_unique: documentation ( source)
<?php
$a = array('a' => 'one', 'b' => 'two');
$b=array('a' => 'three', 'b' => 'four', 'c' => 'five');
//not a union of arrays' values
echo '$a + $b : ';
print_r ($a + $b);
//a union of arrays' values
echo "array_unique(array_merge($a,$b)):";
// cribbed from http://oreilly.com/catalog/progphp/chapter/ch05.html
print_r (array_unique(array_merge($a,$b)));