PHP 8.4.24 Released!

Voting

: two plus three?
(Example: nine)

The Note You're Voting On

bingo at dingo dot com
12 years ago
To write all the lines of the file in other words to read the file line by line you can write the code like this:
<?php
$names=file('name.txt');
// To check the number of lines 
echo count($names).'<br>';
foreach($names as $name)
{
   echo $name.'<br>';
}
?>

this example is so basic to understand how it's working. I hope it will help many beginners.

Regards,
Bingo

<< Back to user notes page

To Top