I would like to reverse the order of this code\'s list items. Basically it\'s a set of years going from oldest to recent and I am trying to reverse that output.
array_reverse() does not alter the source array, but returns a new array. (See array_reverse().) So you either need to store the new array first or just use function within the declaration of your for loop.
The output will be:
c
b
a
So, to address to OP, the code becomes:
';
$a .= $skill->name;
$a .= '';
echo $a;
echo "\n";
$j++;
}
Lastly, I'm going to guess that the $j was either a counter used in an initial attempt to get a reverse walk of $skills_nav, or a way to count the $skills_nav array. If the former, it should be removed now that you have the correct solution. If the latter, it can be replaced, outside of the loop, with a $j = count($skills_nav).