hello there
i am looking for class="online_tr"><img src="http://img1.test.com/black/blue/green/12345.png"/> test string</a> on string
i already tried this code but it it says not found
$pattern = "/class=\"online_tr\"><img src=\"http://img1.test.com/black/blue/green/12345.png\"/> test string</a> /i"; if (preg_match($pattern, $result, $matches)) { echo "found"; } else { //did not find the title echo "not found"; }
please help... thanks
Is none of the string data going to vary? If you're always looking for that exact string, use [man]strstr/man or [man]stristr/man instead ...
Or [man]strpos[/man] or [man]stripos[/man].
Or if this is an HTML document, use the HTML-document-parsing mechanisms already available for the purpose, such as [man]DOM[/man].