By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,991 Members | 1,887 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,991 IT Pros & Developers. It's quick & easy.

how to print out the first value in array after asort($array)

P: 65
my problem is after asort($array) then i want to print out the first value of the array?
Like this array([1] => april [3] =>free [0]=>ghost [2]=>key)

I notice that the first index number is not a zero...and my problem is always print the first value only without know the index number..

Can some one guide me..Thanks
May 16 '07 #1
Share this Question
Share on Google+
2 Replies


shidec
P: 26
try this

Expand|Select|Wrap|Line Numbers
  1. reset($array); // reset pointer, go to first element
  2. echo current($array); //print current element
  3.  
May 16 '07 #2

P: 65
thank so much..it is work in my application...thank you
May 16 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.