Page 1 of 1

Load textfiles into vars

Posted: Wed Oct 22, 2003 8:30 am
by vigge89
Ive started with a filemanager, and I need some help with how to load parts of a textfile into vars, an example of how the textfile would look like:

Code: Select all

Selected_name_for_content

Author(name@domain.com)

Source_(http://www.altavista.com_etc)

content, which will be more than one line....
Line two...
Line three...
Line four...
Last line here
I want the name for the content in one var, the author in 1, source in 1 and the content in one. The text will not include any PHP-tags, just text and maybe some links, or other HTML-tags...

Posted: Wed Oct 22, 2003 9:47 am
by devork
use the file function i
it returns the fiile with every line as array element ..

Code: Select all

<?php
$file=file("hell.txt");
$file[0]... to count($file);

?>