On Monday 10 March 2003 21:13, Diana Castillo wrote:
> If I sort an array, and now the keys are not in numerical order, how can I
> get the key of the first element?
> If I do array_shift I get the first element but I want that key.
Not very elegant -- there must be a better way?
foreach ($doo as $key => $value) {
print "Key:$key Value:$value";
break;
}
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Questionable day.
Ask somebody something.
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php