Tutorial for Opening file on File Handling in PHP

Opening file on File Handling in PHP

PHP File Handling, Create, Open, Read, Write, Append

fopen( ) – This function is used to open a file or URL.

Syntax:-

fopen(filename, mode, include_path, context)
File name – It is the name of file or url.
Mode – in which mode we want to open this file ex: – r, w etc.
Include_path – Set this parameter to ‘1’ or TRUE to specify that you want to search for the file in the PHP include path.
Context – Contexts modify or enhance the behavior of the data stream from and to files.

If the open operation fails, it returns FALSE and an error on failure.

Example:-

Tagged : / / / / /