How to open and read files with PHP

Before reading information from any file,we have to open the file for reading.

This Blog will help you to find the code to read-open-close the file(s) on server we have created with PHP.

  1. Opening a file:fopen()

This function enables to open a PHP written file in the specified mode.fopen() not only creates a connection to file but can also open URL

  1. $file_open = fopen(http://127.0.0.1/”, “r”);

Function fopen( ) doesn’t actually read the contents of a file.All it does is to set a pointer to the file which we want to open. It then returns what’s call a file handle.

Consider an example:

How to open and read files with PHP

– See the full Blog at: How to open and read files with PHP

FindNerd is an effective C, Java, Android, Html, iOS, JavaScript, PHP Developer forum, to instantly resolve your various language queries.

Apart from this, If you have any html language issue, you can post at HTML questions and answeres and get instantly resolved it from highly experienced FindNerd community members.

Advertisements
How to open and read files with PHP

One thought on “How to open and read files with PHP

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s