Compile!
Fast, fat computers breed slow, lazy programmers. (Robert Hummel)
Sorting any structure in PHP
(03.02.2016)
With this example we can sort any kind of data - strings, arrays, objects etc. just changing required atribute in strcmp call.
PHP
function cmp($a, $b)
{
return strcmp($a->created, $b->created);
}
usort($arr, "cmp");
PHP
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus
JavaScript
(13)
PHP
(11)
Brainfuck
(8)
adm
(8)
Joomla
(4)
Canvas
(3)
answers
(2)
API
(2)
CMS
(2)
Modx
(2)
jQuery
(1)
Ajax
(1)
SQL
(1)
Shell
(1)
batch
(1)
10
-6