请实例演绎php遍历数组
$args = array('水果0'=>'香蕉','水果1'=>'苹果','水果2'=>'梨子','水果3'=>'葡萄','水果4'=>'橘子');
foreach ($args as $k=>$v) {
echo $k.'=>'.$v.'<br>';
}
js遍历数组
<script type = 'text/javascript'>
let args = ['香蕉','苹果','梨子','葡萄','橘子'];
for ( let i = 0; i < args.length; i++ ) {
alert( args[i] );
}
</script>