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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wish
    New Member
    • May 2007
    • 65

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

    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
  • shidec
    New Member
    • May 2007
    • 26

    #2
    try this

    Code:
    reset($array); // reset pointer, go to first element
    echo current($array); //print current element

    Comment

    • wish
      New Member
      • May 2007
      • 65

      #3
      thank so much..it is work in my application...t hank you

      Comment

      Working...