PHP with .TXT

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am in the process of a new project. I will have the main text with
HTML saved into a .TXT file. I want the PHP file to fetch the .TXT
file, which would be in the directory songs/. As a beginner, this may
seem very easy... Well, if you do know, please reply... Thank you.

Re: PHP with .TXT

The Numerator contained the following:

Quoted text here. Click to load it


Geoff Berrow  0110001001101100010000000110

Re: PHP with .TXT

include 'songs/file.txt'; // for example, if you just wanna paste it
into your page

or if you want to put file contents into array:

$array = file('songs/file.txt'); // every line in seperate array

or if you want to put file contents into string:

$string = file_get_contents('songs/file.txt');

In future, use PHP-manual. It is really good source of  PHP-knowledge
(even substitutes tutorials).

Site Timeline