in_array() always false...
Posted: Fri Aug 01, 2008 2:53 pm
In trying to write a script that will 'look' at various URL's and detect certain text within the resulting pages, I'm using file() to put the page contents in an array, then in_array() to check for the specific text.
I'm a bit stymied because in_array() always evaluates FALSE. Any idea why?
If you go to the page, you'll see the value for $str right there. Your thoughts?
Thanks in advance for whatever help you can offer!
Jeff
I'm a bit stymied because in_array() always evaluates FALSE. Any idea why?
Code: Select all
<?php
$Page = file("http://www.AgilityEvents.net/sandbox/target.html");
$str = "Hi there!";
echo "Yes ... ";
if (in_array($str, $Page))
{
echo "TRUE";
}
else
{
echo "FALSE";
}
?>
Thanks in advance for whatever help you can offer!
Jeff