October 2005
Intermediate to advanced
372 pages
11h 35m
English
array_unique()
array array_unique ( array arr )The array_unique() filters an array so that a value can only appear once. It takes an array as its only parameter, and returns the same array with duplicate values removed. For example:
$toppings2 = array("Peppers", "Ham", "Cheese", "Peppers");
$toppings2 = array_unique($toppings2);
// now contains "Peppers", "Ham", and "Cheese"