Hi, Can someone help me out with the patern matching part of my script. I basically want to check if my banner is on the page. So I get the page into contents then need to do a pattern matching. The code is:- $text = file_get_contents($url); if (!empty($text)) { //This is where the pattern match has to be ); I want to match this:- <a href="http://www.projectword.co.uk" title="Linking Keywords to your Websites" target="_blank" ><img src="http://www.projectword.co.uk/images/banprom/120x60.png" border="0"/></a> Maybe using a preg_match_all or something. Thanks in advance
if (preg_match("/href=\"(http\:\/\/www\.projectword\.co\.uk)\"/iU",$text,$match)) { echo 'worked'; } else { echo 'didnt work'; } PHP:
If it's that exactly that string, use: if (stristr($text, '<a href="http://www.projectword.co.uk" title="Linking Keywords to your Websites" target="_blank" ><img src="http://www.projectword.co.uk/images/banprom/120x60.png" border="0"/></a>')){ echo "Found"; } else { echo "Not Found"; } PHP: Jay