Blogger Information
Blog 34
fans 0
comment 0
visits 20522
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
php 之循环
小庄
Original
619 people have browsed it

php 之循环

  1. <?php
  2. echo 'foreach 遍历';
  3. echo '</br>';
  4. $arr = ['bmw越野','bmw轿车','bmw跑车'];
  5. foreach($arr as $item){
  6. echo $item."</br>";
  7. }
  8. echo '</br>';
  9. echo 'for 遍历';
  10. echo '</br>';
  11. for($i = 0;$i <= count($arr); $i++){
  12. echo $arr[$i]."</br>";
  13. }
  14. ?>
  15. <script>
  16. let arr = ['bmw越野','bmw轿车','bmw跑车'];
  17. for(let i=0;i<=arr.length;i++){
  18. console.log(arr[i]);
  19. }
  20. </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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!