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 can I check if a value is already in an array?How do I remove an element from an array without changing the index values for the rest of the array?
How do I find the size of an array?
How do I sort an array by key?
How do I remove the first element from an array?
