Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

sort array php

<?php
$fruits = array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple");
asort($fruits);
foreach ($fruits as $key => $val) {
    echo "$key = $val
";
}
?>
//Would output:
c = apple
b = banana
d = lemon
a = orange  
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sort #array #php
ADD COMMENT
Topic
Name
3+4 =