Solved

Order an array in alphabetical order

Posted on 2006-07-15
5
1,276 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

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 look for a specific file type in a local or remote server directory using PHP.

724 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