php Code:
foreach ($html->find('table') as $noscript) {echo $data;
echo $data;
echo $noscript->innertext . "<br>";
}
Now i need to compare every string in this with "google" it can be anything like "GOOGLE" or "Google" , here case doesn't matter.
But how do i check $noscript->innertext
and echo $data;
for "google"
I am unable to think of a way to implement this. Kindly provide me some code example.
Code i tried
foreach ($html->find('table') as $noscript) {
//if (strstr(strtolower($data)||strtolower($noscript->innertext), "google"))
if (preg_match('/google/i', $data || $noscript->innertext)) {
echo "This is Google";
$real = 1;
}
echo $data;
echo $noscript->innertext . "<br>";
}
Second attempt:
if (strstr(strtolower($data)||strtolower($noscript->innertext), "google"))
Both of which are not working.