Skip to content

Instantly share code, notes, and snippets.

@2803media
Created March 24, 2014 17:19
Show Gist options
  • Select an option

  • Save 2803media/9744822 to your computer and use it in GitHub Desktop.

Select an option

Save 2803media/9744822 to your computer and use it in GitHub Desktop.
Fonction de tri de tableaux multi dimensionnel en php
function aasort (&$array, $key) {
$sorter=array();
$ret=array();
reset($array);
foreach ($array as $ii => $va) {
$sorter[$ii]=$va[$key];
}
asort($sorter);
foreach ($sorter as $ii => $va) {
$ret[$ii]=$array[$ii];
}
$array=$ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment