循环类型

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBasal
2016-07-25 09:09:301166semak imbas

Types of loops 循环类型。
  1. $files = array ('index.php', 'reports.php', 'welcome');
  2. echo "This is how foreach works
  3. ";
  4. foreach($files as $file){
  5. echo $file."
  6. ";
  7. };
  8. echo "
  9. ";
  10. echo "This is how for works
  11. ";
  12. for($index = 0; $index
  13. //echo "Index = ".$index."
  14. ";
  15. echo "File = ".$files[$index]."
  16. ";
  17. } Play Angry Birds
  18. echo "
  19. ";
  20. echo "This is how while works
  21. ";
  22. $index = 0;
  23. while($index
  24. //echo "Index = ".$index."
    ";
  25. echo "File = ".$files[$index]."
  26. ";
  27. $index++;
  28. }
  29. ?>
复制代码



Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Artikel sebelumnya:获取文件扩展名函数 Artikel seterusnya:php实现rc4加密算法