Navigation :

Home
Source code
Tutorials
RSS feeds
Articles
Wordpress plugins
Blog
Books
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links




Site Sponsors :

Bookmark :

Links :

software directory
low cost magazines
programmershelp

Downloads :

Misc :

Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming

Valid XHTML 1.0 Transitional


Valid CSS!


store a text file into an array

stores a text file line by line into an array and in this example prints out line 2

<?php
//read a text file into an array
$filename="test.txt";
$lines = array();
$fp = fopen($filename, "r");
while(!feof($fp))
{
//read file line by line into a new array element
$lines[] = fgets($fp, 4096);
}
fclose ($fp);
//display line 2
echo $lines[1];
?>