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
Solved

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

Posted on 2008-06-19
4
268 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
ID: 21828910
$content = file_get_contents('filename.txt');
0
 
LVL 6

Accepted Solution

by:
psychic_zero earned 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

766 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