我正在尝试将 array_reverse 函数实现到这个 foreach 数组中,我相信我在第 3 行调用了错误的变量(嗯,4)
<?php
$j=1;
$skill_slugs = array_reverse( $skill_slugs );
foreach ($skills as $skill) {
$skill = get_term_by( 'slug', trim(htmlentities($skill)), 'skill');
if($skill) {
$skill_slug = $skill->slug;
$skill_slugs .= $skill_slug . ",";
$a = '<li><a href="#" data-filter=".'.$skill_slug.'">';
$a .= $skill->name;
$a .= '</a></li>';
echo $a;
echo "\n";
$j++;
}
}
?>