At 16:35 10.03.2003, Jason Wong said: --------------------[snip]-------------------- >Not very elegant -- there must be a better way? > >foreach ($doo as $key => $value) { > print "Key:$key Value:$value"; > break; >} --------------------[snip]--------------------
Possibly using array_keys()? $keys = array_keys($doo); echo "First key is \"{$keys[0]}\""; array_keys() comes in handy if you want to have random access to an associtive array without knowing the keys. -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php