[PHP] Sorting data in an array
- by kwokwai
Hi all,
I got an array which has 7 types of fruit:
$fruits = array(
"lemon",
"orange",
"banana",
"apple",
"cherry",
"apricot",
"Blueberry"
);
I don't know how to print out the data in a way that the outcome will like this:
<A>
Apple, Apricot (Note that Apricot is followed by Apple in alphabetic order)
<B>
Banana
<C>
Cherry
<L>
Lemon
<O>
Orange
I am sorry that the question may be a bit difficult.
But please kindly help if you could.