graham23s Posted April 5, 2010 Share Posted April 5, 2010 Hi Guys, I'm using a curl request to get some html, when i get the html back: $html = curl_exec($ch); i want to check that $html contains a certain string, what would be the best way to do it? thanks for any help guys Graham Link to comment https://forums.phpfreaks.com/topic/197626-check-html-for-string/ Share on other sites More sharing options...
JAY6390 Posted April 5, 2010 Share Posted April 5, 2010 For a simple string use http://www.php.net/manual/en/function.strstr.php For a regular expression use http://www.php.net/manual/en/function.preg-match.php Link to comment https://forums.phpfreaks.com/topic/197626-check-html-for-string/#findComment-1037193 Share on other sites More sharing options...
the182guy Posted April 5, 2010 Share Posted April 5, 2010 Have you looked at strpos() ? Link to comment https://forums.phpfreaks.com/topic/197626-check-html-for-string/#findComment-1037197 Share on other sites More sharing options...
graham23s Posted April 5, 2010 Author Share Posted April 5, 2010 Thanks mate stristr did the job cheers Graham Link to comment https://forums.phpfreaks.com/topic/197626-check-html-for-string/#findComment-1037207 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.