- print_r: documentation ( source)
- usort: documentation ( source)
<?php
function test($firstValue, $secondValue) {
if ($firstValue > $secondValue) {
return 1;
}
if ($firstValue < $secondValue) {
return -1;
}
return 0;
}
$array = array('a', 'b', 'a', 'b', 'c');
usort($array, 'test');
echo print_r($array);