Category: 07. File Handling

  • Read File

    There are a number of options in PHP for reading data from a file that has been opened with the fopen() function. The following built-in functions in PHP’s library can help us perform the read operation − The fgets() Function The fgets() function can return a line from an open file. This function stops returning on a…

  • Open File

    PHP’s built-in function library provides fopen() function to open a file or any other stream and returns its “reference pointer”, also called as “handle”. The fopen() function in PHP is similar to fopen() in C, except that in C, it cannot open a URL. Syntax of fopen() The fopen() function has the following signature −…