For
From now on, I will record my learning about PHP File Processing and share it with you! I think any programming language will inevitably deal with file systems, so there are a lot of file processing functions in PHP. In the morning, I read the PHP help manual to start recording the learning results, we found that there were more than 80 ~~, Of course, some of these functions are only valid on a specific platform. Some functions do not work on WIN.
In my opinion, the two types of File Processing and string operations are similar in nature, and the file is not a collection of strings! So I put them together to make a simple learning. After all, because there are too many functions, I cannot understand them one by one. But the more I master, doesn't it mean the higher your level, it's not a bad thing to look at your eyes when everything is okay!
PHP file functions
Basename-part of the file name in the returned path
Chgrp-change the group to which the file belongs
Chmod-change file Mode
Chown-change the file owner
Clearstatcache-Clear the File status Cache
Copy-copy an object
Delete-see unlink () or unset ()
Dirname-directory part of the returned path
Disk_free_space-return the available space in the directory
Disk_total_space-returns the total disk size of a directory
Diskfreespace-disk_free_space () alias
Fclose-close an opened file pointer
Feof-test whether the file pointer is at the end of the file
Fflush-outputs buffered content to a file
Fgetc-read characters from the file pointer
Fgetcsv-read a row from the file pointer and parse the CSV Field
Fgets-read a row from the file pointer
Fgetss-read a row from the file pointer and filter out the HTML Tag
File_exists-check whether the file or directory exists
File_get_contents-read the entire file into a string
File_put_contents-write a string to a file
File-read the entire file into an array
Fileatime-the last time the file was accessed
Filectime-This PHP file function obtains the inode modification time of the file.
Filegroup-the group for obtaining files
Fileinode-get the inode of the file
Filemtime-Get file modification time
Fileowner-get the file owner
Fileperms-Get File Permissions
Filesize-get the file size
Filetype-Get file type
Flock-lightweight consultation file locking
Fnmatch-match the file name in the pattern
Fopen-open a file or URL
Fpassthru-all the remaining data at the output file pointer
Fputcsv-format rows as CSV and Write File pointers
Fputs-fwrite () alias
Fread-read files (which can be safely used for binary files)
Fscanf-format input from File
Fseek-locate in file pointer
Fstat-Get file information through the opened file pointer
Ftell-returned file pointer read/write location
Ftruncate-truncates a file to a specified length
Fwrite-write a file (which can be safely used for binary files)
Glob-find the file path that matches the pattern
Is_dir-This PHP file function determines whether the given file name is a directory.
Is_executable-determine whether a given file name can be executed
Is_file-determine whether the given file name is a normal file
Is_link-determine whether a given file name is a symbolic connection
Is_readable-determine whether the given file name is readable
Is_uploaded_file-determines whether the file is uploaded through http post.
Is_writable-determine whether a given file name can be written
Is_writeable-is_writable () alias
Link-create a hard connection
Linkinfo-get the connection information
Lstat-displays information about a file or symbolic connection.
Mkdir-create a directory
Move_uploaded_file-move the uploaded file to a new location
Parse_ini_file-parse a configuration file
Pathinfo-returned file path information
Pclose-Disable process file pointer
Popen-open process file pointer
Readfile-output a file
Readlink-returns the target to which the symbolic connection points.
Realpath-returns the normalized absolute path name.
Rename-rename a file or directory
Rewind-position of the inverted file pointer
Rmdir-delete directory
Set_file_buffer-stream_set_write_buffer () alias
Stat-File Information
Symlink-create a symbolic connection
Tempnam-create a file with a unique file name
Tmpfile-create a temporary file
Touch-set the file access and modification time
Umask-change the current umask
Unlink-delete an object
Of course, some PHP file functions can't be used as they have just been mentioned. Remember to remember a few common functions. At least I think so. Start from the next section to learn about the simple use of some of the key functions. The first FILE processing function we saw in wordpress is dirname: require_once (dirname (_ FILE __). '/wp-load.php'); basically in WP, the file path uses an absolute path!