note 30757 deleted from function.sort by mazzanet

From: Date: Mon, 04 Jul 2005 10:39:42 +0000
Subject: note 30757 deleted from function.sort by mazzanet
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-91415@lists.php.net to get a copy of this message
Note Submitter: Rich Christiansen ---- Trying to sort an array without regard to case (case insensitive?) Try usort(). I needed to sort an associated array without regard to case and this is what I came up with, from modifying the example from the documentation for usort(). function cmp ($a, $b) { return strcasecmp($a["field_name"], $b["field_name"]); } uasort($array, "cmp"); -RIch

« previous php.notes (#91415) next »