InterviewSolution
| 1. |
How To Open A File For Reading? |
|
Answer» If you want to open a file and READ its contents piece by piece, you can use the fopen($fileName, "r") function. It opens the SPECIFIED file, and returns a file handle. The second argument "r" TELLS PHP to open the file for reading. Once the file is open, you can use other functions to read data from the file through this file handle. Here is a PHP script example on how to use fopen() for reading: If you want to open a file and read its contents piece by piece, you can use the fopen($fileName, "r") function. It opens the specified file, and returns a file handle. The second argument "r" tells PHP to open the file for reading. Once the file is open, you can use other functions to read data from the file through this file handle. Here is a PHP script example on how to use fopen() for reading: |
|