Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199807

Re: [PHP3] "Next" command? From: Lars Torben Wilson (torben <email protected>)
Date: 07/17/98

Colin Viebrock writes:
> Is there a PHP equivalent to the perl "next"? i.e. how could I do
> something like:
>
> foreach $ln ( <email protected>) {
> next if $ln =~ /^\;/;
> next if $ln =~ /^@;/;
> if($ln =~ /\; serial/) {
> ......
> }

I think you're looking for the continue statement:

while ( list( , $val ) = each( $file ) ) {
   if ( ereg( "^[@]?;", $val ) ) continue;
   if ( ereg( "; serial", $val ) ) {
      . . .
   }
}

Torben

--
PHP 3 Mailing List   http://www.php.net/
To unsubscribe send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest list:  php3-digest-subscribe <email protected>
For help: php3-help <email protected>  Archive: http://www.tryc.on.ca/php3.html