(driving me nuts)
Hi there. I wonder if anyone can help?
I'm including a page from Google in search.php, passing some
parameters. So far so good. Then I'm asking to look through that
Google page for a text match, and return true or false.
eregi returns false whatever the case,
similar_text returns true whatever the case.
Can someone sort me out - oops, HELP me out ?
Thanks thanks in advance !
(code)
$page="http://www.google.com/search$search";
// check to see if on page 1
$text="my_text_ here";
if (eregi('/\b$text/i', '$page')) {
echo "Match";
} else {
echo "No Match";
}
(/code)
OR
(code)
$page="http://www.google.com/search$search";
// check to see if on page 1
$text="my_text_ here";
if (similar_text('/\b$text/i', '$page')) {
echo "Match";
} else {
echo "No Match";
}
(/code)
Hi there. I wonder if anyone can help?
I'm including a page from Google in search.php, passing some
parameters. So far so good. Then I'm asking to look through that
Google page for a text match, and return true or false.
eregi returns false whatever the case,
similar_text returns true whatever the case.
Can someone sort me out - oops, HELP me out ?
Thanks thanks in advance !
(code)
$page="http://www.google.com/search$search";
// check to see if on page 1
$text="my_text_ here";
if (eregi('/\b$text/i', '$page')) {
echo "Match";
} else {
echo "No Match";
}
(/code)
OR
(code)
$page="http://www.google.com/search$search";
// check to see if on page 1
$text="my_text_ here";
if (similar_text('/\b$text/i', '$page')) {
echo "Match";
} else {
echo "No Match";
}
(/code)
Comment