hi david
i'll give you a bit of code
which will pickup some text. from a text file and will echo it on the page.
i think this should help you out
copy the code replace the value of the variable $fileToBeOpend to the path of the text file thats to be opened. make sure the file is there
<?php
// fopen — Opens file or URL and links it to
// (fp is a file pointer)
// (here it opens in read-onlymode)
$fileToBeOpened="path/to/the/textfile.txt";
$filepointer= fopen($fileToBeOpened,"r");
while(!feof($filepointer))
{
// fgets — Gets line from file pointer (fp here)
// filesize -- Gets file size
$strSingleLine = fgets($filepointer,filesize($fileToBeOpened));
// concanate the single lines obtained to a large string
$strDescription. = $strSingleLine;
}
// converting new line or rather carriage returns to <br> tags using nl2br function
// string nl2br(string string);
$strDescription. = nl2br($strDescription);
// actual printing of the text obtained
echo "The file : ".$fileToBeOpened." contains <br>";
echo $strDescription;
// destroying the mem variables used in to code
unset($filepointer);
unset($fileToBeOpened);
unset($strSingleLine);
unset($strDescription);
?>
if you still have quereies
mail me at dipenmistry@rediffmail.com