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
)
More arrays PHP Questions
How do I remove and view the last element of an array?How do I count the number of times a value appears in an array?
How do I find out if a value is already in an array?
How do I return all the values in an array?
How do I add to the end of an array and know how large the array is?