Blogger Information
Blog 14
fans 0
comment 0
visits 8795
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
请实例演绎php遍历数组与js遍历数组的区别
于星辉
Original
421 people have browsed it
  1. <!DOCTYPE html>
  2. <html lang = 'en'>
  3. <head>
  4. <meta charset = 'UTF-8'>
  5. <meta http-equiv = 'X-UA-Compatible' content = 'IE=edge'>
  6. <meta name = 'viewport' content = 'width=device-width, initial-scale=1.0'>
  7. <title>BMW</title>
  8. </head>
  9. <body>
  10. <h2><? echo '宝马轿跑BMW好车'?></h2>
  11. <ol>
  12. <? foreach ( $cars as $car ):?>
  13. <li style = 'color:red'>
  14. <a href = ''><? echo $car?></a>
  15. </li>
  16. <?endforeach?>
  17. </ol>
  18. <script type = 'text/javascript'>
  19. let cars = ['宝马3GT xDrive 330li 耀石灰', '宝马X5 xDrive30i x', '宝马750li xdrive v8 M'];
  20. for ( let i = 0; i < cars.length; i++ ) {
  21. alert( cars[i] );
  22. }
  23. </script>
  24. </body>
  25. </html>
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