PHPverse 2025

Voting

: min(five, four)?
(Example: nine)

The Note You're Voting On

eriewave at hotmail dot com
15 years ago
If you need to sort an array containing some equivalent values and you want the equivalents to end up next to each other in the overall order (similar to a MySQL's ORDER BY output), rather than breaking the function, do this:

<?php

sort
($array, ksort($array))

?>

-When the sort() function finds two equivalents, it will sort them arbitrarily by their key #'s as a second parameter.

-Dirk

<< Back to user notes page

To Top