The file operation functions in PHP3.0 are similar to those in C, but there are some extensions, especially in addition to the support
In addition to accessing local files, you can also access HTTP and FTP URLs. You only need to pass these URLs as file names to file operation functions.
The main file operation functions are:
(1) fclose, feof, fgetc, fgets, fopen, fputs, fseek, ftell, mkdir, readlink, rename, rewind, rmdir, stat, unlink
These functions are similar to functions with the same name in C.
(2) chgrp, chmod, chown, copy
The meanings of these functions are also easy to understand:
Chgrp (file name, group );
Chmod (file name, mode );
Chown (file name, user );
Copy (source file name, target file name );
Note that these functions use the file name instead of the file number returned by fopen.
(3) file_exists, fileatime, filectime, filegroup, fileinode, filemtime, fileowner, filesize, filetype, fileperms, fileumask, is_dir, is_executable, is_file, is_link, is_readable, available
These are file information functions. Most of them accept a file name as a parameter.
(4) fgetss
Usage:
Fgetss (file number, maximum length );
Read a row of the file or until the maximum length (similar to fgets), but remove all HTML and PHP markup.
(5) file
Usage:
File (file Name );
Returns an array. Each element is a row in the file.
(6) tempnam
Usage:
Tempnam (directory name, prefix );
Returns a temporary file name.
(7) basename, dirname
Obtain the part of the file name and directory name in the file path. in Windows, "/" and "" can both be used as Directory delimiters. In other systems, only "/" is allowed.