Skip to main content
Progzoo.net
Tutorials
Guides
Edit
Java
C#
C++
Perl
PHP
Python
Ruby
VB
Hide Sidebar
Show Sidebar
<Progzoo Sections>
ProgZoo
Tutorials
How to...
Assessments
Help
<Other>
To do list
Recent changes
Random page
Personal
Log in / create account
Views
PHP
Discussion
View source
History
Toolbox
What links here
Related changes
Upload file
Special pages
Printable version
PHP:Read a Text File
From Progzoo
PHP:Top Ten Tips
Hello World
Convert to Number
Read Text File
Sum an Array
Count 0 to 9
Hash Table
Regular Expression
Read Database
Read XML
Define a Class
You can open a text file and read each line.
The text file [../haggis.txt haggis.txt] includes some lines of text.
.
<? $fh = fopen('haggis.txt','r'); while (!feof($fh)){ $line = fgets($fh); echo $line; } fclose($fh); ?>
[
Font
] [
Default
] [
Show
] [
Resize
] [
History
] [
Profile
]
test text