Blogger Information
Blog 19
fans 0
comment 0
visits 10115
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
0802 PHP编程作业
bloght5386
Original
452 people have browsed it

请实例演绎php遍历数组

  1. $args = array('水果0'=>'香蕉','水果1'=>'苹果','水果2'=>'梨子','水果3'=>'葡萄','水果4'=>'橘子');
  2. foreach ($args as $k=>$v) {
  3. echo $k.'=>'.$v.'<br>';
  4. }

js遍历数组

  1. <script type = 'text/javascript'>
  2. let args = ['香蕉','苹果','梨子','葡萄','橘子'];
  3. for ( let i = 0; i < args.length; i++ ) {
  4. alert( args[i] );
  5. }
  6. </script>
Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post