?
Solved

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

Posted on 2008-06-19
4
Medium Priority
?
288 Views
Last Modified: 2012-05-05
How to use PHP to read a file on the server?
0
Comment
Question by:mawingho
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 49

Expert Comment

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

Accepted Solution

by:
psychic_zero earned 2000 total points
ID: 21828917
0
 

Author Comment

by:mawingho
ID: 21828932
Why the extra spaces are deleted?
0
 
LVL 1

Expert Comment

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

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

764 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