how to search a string from a text file
Posted: Fri Jul 12, 2002 10:44 pm
i have stored data in a text file "data.txt" and i want to search a email address
form that file can i do like this
$filename="data.txt";
$fptr=fopen($filename,"r");
$content=fread($fptr,filesize ($filename));
fclose($fptr);
if(strstr($content,$email))
{
echo <<< THIS
<font color="red" size="+2" face="verdana">
You have already signed the guestbook
</font>
THIS;
will this work or there is any thing to be added or deleted
plz help me
form that file can i do like this
$filename="data.txt";
$fptr=fopen($filename,"r");
$content=fread($fptr,filesize ($filename));
fclose($fptr);
if(strstr($content,$email))
{
echo <<< THIS
<font color="red" size="+2" face="verdana">
You have already signed the guestbook
</font>
THIS;
will this work or there is any thing to be added or deleted
plz help me