preg_match sounds like what you want.
More info can be found here:
http://us2.php.net/manual/en/function.preg-match.php
Good luck!
You can use preg_match if you're going to search for a pattern in a string.
However, if you're going to look for just a string, then you should use a function such as strstr() or stristr()eg: case sensitive
[PHP]
if (strstr('http://example.com/sports.ext', 'sports')) {
echo 'found';
} else {
echo 'not found';
}[/PHP]
preg_match() is much slower than strstr() and also uses more resources as it matches a pattern.
digital-ether
Nearly a Posting Virtuoso
1,293 posts since Sep 2005
Reputation Points: 461
Solved Threads: 101