/ Published in: PHP
sort by second column then first one
Expand |
Embed | Plain Text
<? //sort by second column then first one function KES_cmp($a, $b) { global $orderBy; $result= 0; foreach( $orderBy as $key => $value ) { if( $a[$key] == $b[$key] ) continue; $result= ($a[$key] < $b[$key])? -1 : 1; if( $value=='desc' ) $result= -$result; break; } return $result; } print "</br<b>Source</b></br>"; print "</br<b>Result</b></br>"; ?>
You need to login to post a comment.
