Answers for "go to next iteration of a loop php"

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

Code answers related to "go to next iteration of a loop php"

Browse Popular Code Answers by Language