array sort function: how to sort array in ascending value order in php
sortFunction.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>array sort function: how to sort array in ascending value order in php</title>
</head>
<body>
<h2 style="color:Seagreen; font-style:italic">php array function example: using sort function</h2>
<hr width="550" align="left" color="Green" />
<br />
</div>
<?php
$Color = array("Red","Green","Blue","Orange","SeaGreen");
echo '<div style="font-size:large; color:DarkRed;">';
echo "Colors without sorting: ";
print_r($Color);
echo "</div>";
echo "<br />";
sort($Color);
echo '<div style="font-size:large; color:DarkOrange;">';
echo "Colors ascending sorting: ";
print_r($Color);
echo "</div>";
?>
</body>
</html>