RE: [PHP] Do I Need preg_match?
| From: | Christensen, BruceX R | Date: | Wed, 09 Aug 2000 21:38:17 +0000 |
| Subject: | RE: [PHP] Do I Need preg_match? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-11000@lists.php.net to get a copy of this message | ||
There's really no need to use ereg (preg_match works fine), but this'll do
it:
if (ereg("(AR|AU|BD|BN|BG|GW|NA|PH|SG|ZA|TN|VE)", $COUNTRY)) { return; }
--Bruce
Bruce Christensen
Intel Corporation
brucex.r.christensen@intel.com
-----Original Message-----
From: Kurt Boyer [mailto:kboyer@matchlogic.com]
Sent: Wednesday, August 09, 2000 2:33 PM
To: 'Php-General (E-mail)'
Subject: [PHP] Do I Need preg_match?
In converting the following PERL regular expression to equivalent PHP code,
is the preg_match function the way to go, or is there a way to do it with
ereg?
if($COUNTRY =~ /AR|AU|BD|BN|BG|GW|NA|PH|SG|ZA|TN|VE/) { return; }
---
Kurt A. Boyer
Matchlogic, Inc.
http://www.matchlogic.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net