先整个PHP循环代码示例
<?php
$lans = ['java','PHP','JavaScript','C++','C语言'];
?>
<? foreach ($lans as $lan) :?>
<li style="color:aquamarine">
<a href=""> <? echo $lan ?></a>
</li>
<?endforeach?>
下面是js循环代码示例
let lans = ['java','PHP','JavaScript','C++','C语言'];
for ( let i = 0; i < lans.length; i++ ) {
alert( lans[i] );
}