Posts

Showing posts with the label PHP File System

PHP File System | PHP Gurukul

Image
 This tutorial deals with the opening , closing, reading and writing of file. There are dedicated function for performing these operations in PHP. In order to open a file, fopen() can be used. Calling this function typically requires two parameters namely filename and the mode in which the programmer wishes to open the file. The different modes available in PHP are as follows- Mode Function r This mode opens the file for only reading. The file pointer points to the first character of the file. r++ This mode opens the file for reading as well as writing. The file pointer points to the first character of the file. w this mode opens the file for only writing. The file pointer points to the beginning of the file. Moreover, the file length is truncated to zero. In case the file doesn’t exist, then the system tries to create a file. w++ This mode opens the file for only writing and reading. The file pointer points to the beginning of the file. Moreover, the file length is truncated to z...