fopen fgets....
Posted: Mon Feb 16, 2004 2:37 pm
Oke i got this working, however i need to add like single break tags in de output.
How would i do such a thing ( some example if possible. )
How would i do such a thing ( some example if possible. )
Code: Select all
// this is what i use to create the *.ans file
$infofile = "addfaq.ans";
$openfile = fopen ($infofile, "w")
or die("Couldnt open the file");
fwrite ($openfile, $faqadd);
fclose ($openfile);
$openfile = fopen ($infofile, "r")
or die("Couldnt open the file");
$file_size=filesize($infofile);
$file_contents= fread ($openfile, $file_size);
$msg="$file_contents"; // feedback
fclose ($openfile);Code: Select all
// my code to open *.ans file
// txt files gave me double breaks after every line
$headline = "txt/headline.ans";
$openfile = fopen($headline , "r")
or die ("Sorry we couldnt process the request");
while (!feof ($openfile))
{
$msg = fgets($openfile, 1024);
echo "$msg", "\n";
}