Solved

How to use PHP to read a file on the server?

Posted on 2008-06-19
4
241 Views
Last Modified: 2012-05-05
How to use PHP to read a file on the server?
0
Comment
Question by:mawingho
4 Comments
 
LVL 49

Expert Comment

by:Roonaan
Comment Utility
$content = file_get_contents('filename.txt');
0
 
LVL 6

Accepted Solution

by:
psychic_zero earned 500 total points
Comment Utility
0
 

Author Comment

by:mawingho
Comment Utility
Why the extra spaces are deleted?
0
 
LVL 1

Expert Comment

by:kambo_rambo
Comment Utility
$datafp = fopen("yourfile.txt", "r");
$line = fgets($datafp);
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now