August 2003
Intermediate to advanced
1104 pages
19h 27m
English
Communication with files follows the pattern of opening a stream to a file, reading from or writing to it, and then closing the stream. When you open a stream, you get a resource that refers to the open stream. Each time you want to read from or write to the file, you use this stream identifier. Internally, PHP uses this integer to refer to all the necessary information for communicating with the file.
To open a file on the local file system, you use the fopen function. It takes a name of a file and a string that defines the mode of communication. This may be r for read-only or w for write-only, among other modes. It is also possible to specify an Internet address by starting the filename with http:// or ftp:// ...
Read now
Unlock full access