Image

Imageffwd wrote in Imagephp 😡frustrated

getting contents of a text file

After some time of procrastination, I am finally trying to learn php. So far, I have written a script that opens a connection to MySQL, and displays the data I specified into a webpage. But I can't seem to figure out one simple little thing. My question is, and I have been struggling with this for almost 6 hours now, is how can I display the contents of a simple text file? I have spent half the day looking it up, and trying different things, but nothing is working so far.

Example (and I have tried many variations of doing this):


<?php
$text="info.txt";
echo file_get_contents("$text");
?>


I just want to retrieve the contents of a text file, and display them in a webpage. Nothing fancy, no cvs, xml, or tab delimited text. Just simple unformatted text in a .txt file. Thanks to anyone who can help.