Re: search string
| From: | Brian Clark | Date: | Mon, 16 Apr 2001 01:33:28 +0000 |
| Subject: | Re: search string | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-48685@lists.php.net to get a copy of this message | ||
Hi Tobias,
@ 7:20:00 PM on 4/15/2001, Tobias Talltorp wrote:
> I think you want regular expressions...
> Try this on for size:
> $str = "http://www.yahoo.com/somedir/somepage.html";
> if (preg_match("/www.yahoo.com/i", $str)) {
> print "Your submission cannot be accepted";
> } else {
> print "You are good";
> }
...
I doubt there is a need to use regular expressions just to find out of
a string has yahoo.com in it.
-Brian
--
PGP is spoken here: 0xE4D0C7C8
Please, DO NOT carbon copy me on list replies.