How do I sort the members of an array by value?
This takes the array as its parameter, as in sort($array).
Here's a simple example:
<?php
$myworld = array("world","hello");
sort($myworld);
print_r($myworld);
?>
Which looks a little like this:
Array
(
[0] => hello
[1] => world
)
Comment on this Question and Answer >>>
ASK A QUESTION
More arrays PHP Questions
How do I reverse sort an array by key?How do I turn an array into a string?
How do I count the number of times a value appears in an array?
How can I mix up the order of values in an array?
what is a array?
