groups

name language licence
Contact Form 1 PHP Other
Email Obfuscation PHP Other
MultiSort PHP Other
Show Recent Posts 2 PHP Other
JavaScript Compressor - PHP PHP GPL 2
officeHours OPEN/CLOSE visitor notification PHP Other
Contact Form 2 PHP Other
Consolidate RapidWeaver style sheets PHP Other

< 1 2 >



language: PHP
licence: Other

MultiSort

options: view full snippetsend to code collector
<?
//sort by second column then first one
$orderBy=array('0'=>'asc', '1'=>'asc');

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;
  }
	
(Continues...)