I'm using sort to sort an array alphabetically that's done like this:
$Consumer[] = "Norman";
$Consumer[] = "Food";
$Consumer[] = "Clothes";
$Consumer[] = "Chips";
But when I use this code to output the array, it won't work.
$cat = sort($Consumer);
foreach ($cat as $value)
{
echo '<option value="'.$value.'">'.$value.'</option>';
}
It works if I remove the sort. What am I doing wrong here and how do I set this right?