Hi Mark,
I have done few changes and now u can check this program... it will work..
$is_date = "false";
$file = file("datetext.txt");// this will read the specified file into an array... 🙂
for($i=0; $i < sizeof($file); $i++)
{
if ($file[$i] == "2001-05-06")
{
$is_date = "true";
break;
}
}
echo $is_date;
The problem in ur program was this..
$is_date = "false";
$file = fopen(FILE,"r"); //here u have opened the file, but u have not read the file anywhere...(u also need to specify the file name)
explode($file); // here also u r using $file which is not a string neither an array... it is just the return value of the fopen function u have used..
for($i=0; $i<$count; $i++) {
if ($date == "2001-04-06") {
$is_date = "true";
break;
}
}// here also u have used $count and $date which r again not defined any where...means $count should be the size of the array of elements from the text file and $date should be the array itself...
Hope u have understood everything and ur problem is solved, still if u need to know something, u can mail me or reply to this post...
Regards,
Shaju