Can anyone explain how this usort actually works |
Well, usort is only useful when you do not care for key association, and you need a special, complex(ish) logic to sort, like in your example, where you are sorting based on a specific key. If you have just a normal [3,5,6,4,2,1,9,8] array, then "asort" will probably be enough. Take a looksy for all the available options: http://php.net/manual/en/array.sorting.php
Website: http://tomaz.lovrec.eu
GitHub: https://github.com/slax0rr Twitter: https://twitter.com/slax0rr |
Messages In This Thread |
Can anyone explain how this usort actually works - by PaulD - 09-27-2015, 05:30 PM
RE: Can anyone explain how this usort actually works - by slax0r - 09-28-2015, 12:20 AM
RE: Can anyone explain how this usort actually works - by Narf - 09-28-2015, 02:38 AM
RE: Can anyone explain how this usort actually works - by PaulD - 09-28-2015, 03:24 AM
RE: Can anyone explain how this usort actually works - by slax0r - 09-28-2015, 04:22 AM
RE: Can anyone explain how this usort actually works - by PaulD - 09-28-2015, 04:42 AM
RE: Can anyone explain how this usort actually works - by slax0r - 09-28-2015, 04:52 AM
RE: Can anyone explain how this usort actually works - by PaulD - 09-28-2015, 05:22 AM
RE: Can anyone explain how this usort actually works - by ignitedcms - 10-01-2015, 12:09 PM
RE: Can anyone explain how this usort actually works - by PaulD - 11-09-2015, 08:15 AM
|