Re: unless something...

From: Date: Thu, 12 Sep 2002 23:29:47 +0000
Subject: Re: unless something...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-116221@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On September 12, 2002 09:47, Magnus Solvang wrote: > I'm used to the unless-statement in perl... How do I do this: > > if string A or B are NOT in string C, then do something and quit. > > In perl, I would do this: > > unless ($c =~ /$a|$b/) { > blabla > exit 0 > } ... and in the more verbose PHP you could say if( ! preg_match("/$a|$b/", $c) ) { blah blah blah exit(0); } Cheers! --zak -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9gSNrb6QONwsK8bIRAnIiAKCPcmTiSO+7G4dwt9pQ0LyXnd/o7wCgiIiX YRogR4f45nZLdGioazfwvAo= =PxCf -----END PGP SIGNATURE-----

« previous php.general (#116221) next »