I am trying to first sort an array and then displaying it alphabetical order
$testArray[test] = 'London';
$testArray[fsee] = 'Cardiff';
$testArray[pol] = 'Edinburgh';
$testArray[bede] = 'Manchester';
asort($testArray);
foreach ($testArray as $key => $value) {
echo $key . ' -- ' . $value . '<br/>';
}
And i like to alphabetical sort on test, fsee, pol and bede, so it return
bede -- Manchester
fsee -- Cardiff
pol -- Edinburgh
test -- London
$stuff[ something ]that it does not know ifsomethingis a constant, or a string to use (like your example code you provided in the Q)$testArray[test]should really be written as$testArray['test'].. if that helps.