Re: search string
| From: | Brian Clark | Date: | Sun, 15 Apr 2001 23:50:25 +0000 |
| Subject: | Re: search string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-48669@lists.php.net to get a copy of this message | ||
Hi Joseph,
@ 12:08:46 PM on 4/15/2001, Joseph Bannon wrote:
> What is the function to search a string? Basically, I want search a string
> (a url) to see if it has "www.yahoo.com" in it and if yes, tell the user
> their submission cannot be accepted.
<?php
$string = 'www.yahoo.com';
print(strstr($string,'yahoo.com') ? 'Failed.' : 'Passes');
?>
-Brian
--
PGP is spoken here: 0xE4D0C7C8
Please, DO NOT carbon copy me on list replies.