Web development

PHP – Array loop

Hits: 1 PHP – Array loop   Iterate array with foreach() The main PHP built-in function used to iterate through array elements is foreach(). We learned about the foreach() loop in a dedicated tutorial. Here is an example of how to loop through an array using foreach. PHP <?php $file_list = array( “index” => “home_page.php”, “article” => “article_page.php”, …