Solved

Order an array in alphabetical order

Posted on 2006-07-15
5
1,270 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Link failure 16 68
PHP delete contents of file- before writing to it 6 50
How Close unsubmited attempts 10 46
while read ID; do 4 56
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…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

733 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