I have a variable with some various phrases/words in there, these are all separated by a comma. They are currently in the correct order within this variable.
However when I use
<?php
explode(",", $variable)
?>
The result when I loop through this array one by one and print out these words into a list is that they are in alphabetical order.
So my question is how do I retain this order.
The loop is as follows
<?php
if(!empty($variable)) {
print '<ul>';
foreach($variable as $key=>$value) {
print '<li>- '.$value.' ' . '</li>';
}
print '</ul>';
}
?>