Does anyone know if there is such a feaure in a foreach loop? In Perl, I could use something like;
In PHP, the only function I can see if 'break', which seems to do the same as 'last' in Perl. Is there such a thing as 'next' in PHP?
Cheers
Andy
Code:
foreach (@array) {
if ($_ eq "test") { last; } # break from the loop if the entry == test
elsif ($_ =~ /\d/) { next; } # skip next's
}
In PHP, the only function I can see if 'break', which seems to do the same as 'last' in Perl. Is there such a thing as 'next' in PHP?
Cheers
Andy