The filesystem functions provide a wide range of tools to access and manipulate the filesystem.
OverviewPHP's filesystem functions provide a fairly broad range of functionality. All the standard functions that programmers expect are included - opening, reading, and writing files; querying the filesystem; changing permissions; copying and deleting files; etc. Many of these functions have been transparently extended to work with HTTP and FTP resources, allowing easy reading of remote files.
There are also a series of convenience functions like fgetcsv() , which parses CSV-format data while reading it from a file, and file() , which reads a file and then places it, line by line, into an array.
The group also includes some miscellaneous filesystem-related functions to generate names for temporary files ( tempnam() ) and open pipes to commands ( popen() ) . Note that most of the directory-related functions are documented in the Directory Functions module.
Configuring the Filesystem FunctionsThe following configuration directives can be used to control the behavior of the Filesystem functions.
Installing Filesystem SupportThese functions are built into PHP by default and can only be disabled by editing the source code and recompiling, or by using the disable_functions directive in php.ini.
Additional InformationFor more information, see:
Table of Contents
PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing (Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch). This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). The authors of this book have elected not to choose any options under the OPL. This online book was obtained from http://www.fooassociates.com/phpfer/ and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4 for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All persons and entities shall have neither liability nor responsibility to any person or entity with respect to any loss or damage arising from the information contained in this book.