Answers for "for loop in php continue"

PHP
5

for loop php continue to next item

$stack = array('first', 'second', 'third', 'fourth', 'fifth');

foreach($stack as $v){
    if($v == 'second') {
      continue;
    }
    echo $v.'<br>';
}
/*
first
third
fourth
fifth
*/
Posted by: Guest on December-27-2020
1

continue in php

<?php
for($i=0;$i<4;$i++)
{
    if($i==3)
    {
        continue;   
    }
    echo $i;
}
?>
Posted by: Guest on January-05-2022

Browse Popular Code Answers by Language