1
I have a array
, in which values are arrays
.
How can I order the first array
, accordingly with a value that is in the second array
?
Example:
array(array(id=>5), array(id=>2), array(id=>1), array(id=>3));
The intended is:
array(array(id=>1), array(id=>2), array(id=>3), array(id=>5));
excellent implementation of Spaceship Operator.
– Allan Andrade
Obgado @Allanandrade, in fact was adapted from a reply on Soen, I put the link in the reply
– Miguel
I can’t get the same scheme to sort by date, that is, where in the array above I have integers, have a datetime (2016-08-25 19:57:28). Is there any simple way to resolve this situation?
– M_b_85