Solved

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

Posted on 2008-06-19
4
255 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mcrypt_create_iv() is deprecated 4 76
Move wordpress site 3 26
mysql between clause 2 10
Wordpress errors showing up, hacked? 4 16
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

861 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

25 Experts available now in Live!

Get 1:1 Help Now