Voting

: five plus four?
(Example: nine)

The Note You're Voting On

lil at thedreamersmaze dot spam-me-not dot org
19 years ago
There's one little thing missing in this useful bit of code posted by mbirth at webwriters dot de:

<?php

function natsort2d(&$aryInput) {
$aryTemp = $aryOut = array();
foreach (
$aryInput as $key=>$value) {
reset($value);
$aryTemp[$key]=current($value);
}
natsort($aryTemp);
foreach (
$aryTemp as $key=>$value) {
$aryOut[$key] = $aryInput[$key];
// --------^^^^ add this if you want your keys preserved!
}
$aryInput = $aryOut;
}

?>

<< Back to user notes page

To Top