Answers for "iterate php"

PHP
6

for loop in php

/*
For loop in php
*/

<?php
for ($i = 0; $i < 10; $i++) {
     echo $i."<br>";
} 
?>
Posted by: Guest on May-06-2020
4

how to iterate through php array

$ar = ['Rudi', 'Morie', 'Halo', 'Miki'];

for ($i=0, $len=count($ar); $i<$len; $i++) {
    echo "$ar[$i] \n";
}
/*
Rudi 
Morie 
Halo 
Miki 
*/
Posted by: Guest on January-16-2020

Browse Popular Code Answers by Language