Solved

Order an array in alphabetical order

Posted on 2006-07-15
5
1,265 Views
Last Modified: 2012-06-22
How can I order an array in so that the values are in alphabetical order?
0
Comment
Question by:mnb93
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
Raynard7 earned 250 total points
ID: 17113972
The sort function will sort an array alphabetically

$fruits = array("lemon", "orange", "banana", "apple");
sort($fruits);

which is from the manual (http://au.php.net/sort)
0
 
LVL 5

Author Comment

by:mnb93
ID: 17116071
The question has nothing to do with that question as I am using mysql to order in the question.
0
 
LVL 14

Expert Comment

by:ThG
ID: 17116113
ok, let it be then.

anyway please use the manual sometimes.
http://www.php.net/manual/en/
0
 
LVL 5

Author Comment

by:mnb93
ID: 17116135
Yeah, I just forgot about the sort function, and I had to go to dinner so yeah...
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question