I am getting a webpage using file_get_contents();
:
$file = file_get_contents('http://example.com');
How do I check if the webpage contains the text 'hello' or 'bye'
I am getting a webpage using file_get_contents();
:
$file = file_get_contents('http://example.com');
How do I check if the webpage contains the text 'hello' or 'bye'
$file = file_get_contents('http://example.com');
$exists = (strpos($file, 'hello') !== false) || (strpos($file, 'bye') !== false);
if ($exists !== false) {
print 'Found';
}
$file = file_get_contents('http://example.com');
if (strpos($file, 'hello') !== false)
{
echo "Exist..";
}