<?php
$shop = array ( "rose" => "5.00",
"daisy" => "4.00",
"orchid" => "2.00",
);
asort($shop);
foreach($shop as $key => $value)
echo $key." costs ".$value." dollars<br />"; //print the array elements
?>
<?php
$shop = array ( "rose" => "5.00",
"daisy" => "4.00",
"orchid" => "2.00",
);
ksort($shop);
foreach($shop as $key => $value)
echo $key." costs ".$value." dollars<br />"; //print the array elements
?>
<?php
$flowers = array("rose", "daisy" , "orchid", "tulip", "camomile");
sort($flowers);
for ($i=0; $i <= 4; $i++) //prints the array elements
echo $flowers[$i]."<br \>";
?>
<?php
$prices = array(1.25, 0.75 , 1.15, 1.00, 0.50);
sort($prices);
for ($i=0; $i <= 4; $i++) //prints the array elements
echo $prices[$i]."<br \>";
?>