RE: [PHP] Check if a word is in my string.
| From: | Jason Murray | Date: | Wed, 29 Aug 2001 00:16:49 +0000 |
| Subject: | RE: [PHP] Check if a word is in my string. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-64925@lists.php.net to get a copy of this message | ||
> use:
> preg_match('/\Wgood\W/',$var);
> or
> preg_match('/\bgood\b/',$var);
Or, you could just try strstr($haystack, $needle) ...
Jason
--
Jason Murray
jasonm@melbourneit.com.au
Web Developer, Melbourne IT
"Work now, freak later!"