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
when i fetch the record in the database but they skip first record in the databaseI want to invert my array, can I do this?
How do I remove an element from an array without changing the index values for the rest of the array?
what is the return value of array_unique()?
How do we sort an array of names taken from a text file, displaying only unique names?
