Solved

Order an array in alphabetical order

Posted on 2006-07-15
5
1,260 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
Comment Utility
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
Comment Utility
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
Comment Utility
ok, let it be then.

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

Author Comment

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

Featured Post

Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now