uasort

It sorts an array with a user-defined comparison function and maintain index association

Example

<?php
echo “<pre>”;
$lan = array(“PHP”,”ASP”,”JSP”);
uasort($lan);
print_r($lan);
?>

Output

Array
(
[0] => PHP
[1] => ASP
[2] => JSP
)

Share