communication
 databases
 directories
 file handling
 html and code
 image editing
 image listing
 sessions and co
 string handling
 information
 forms
 apple stuff
 image handling
 array handling
 lixlpixel
php - snippets
google search terms detected and highlighted.
remove highlighting | keep highlighting
make snippet in "file handling" - download "read file"
 search
php - snippets

Valid CSS!

php webring logo
prev next
random list
join the Ring!

file handling - read file was created/last modified on Mon 15 Mar 2004 8:09 AM


this will read a remote file and return the content as an array where each line is one item in the array.

<?

$lines
= file('data/file.txt');
$l_count = count($lines);

for(
$x = 0; $x< $l_count; $x++)
{
  echo
$lines[$x];
}

?>

learn more about some of the PHP functions used in this snippet: array, count, each, echo, file, for, return

view the GNU general license - view the GNU library license - search on PHPsnippets - see your code like this

 a lixlpixel.com site

PHParadise.com - PHP-classes.org - your site on safari