array sorting
Posted: Mon Aug 15, 2005 6:59 am
i need to sort an array by the amount of characters in the value. how would i go about doing that
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$temp = array_map('strlen',$array);
asort($temp);
$new = array();
foreach($temp as $k => $blah)
{
$new[$k] = $array[$k];
}