PHP file Function Manual Overview _php Tutorial

Source: Internet
Author: User
Tags http post rewind
For

From now on I will learn about PHP file processing related knowledge record down, share! I think any kind of programming language is unavoidable to deal with the file system, so in PHP there are a lot of file processing functions, in the morning when the PHP help manual to start recording the results of learning, Found that there are more than 80 ~ ~, of course, some of these functions are only valid on a specific platform, some functions on win is not working.

File processing and string manipulation, in my opinion, the nature of the two is similar, the file is not a collection of strings! So I put them together, to make a simple study, after all, because of the function too much, not one to understand, but the more mastered is not the higher the level of your representative, all the time to look at the two eyes is not a bad thing!

PHP file Functions Daquan

basename-returns the file name portion of the path
chgrp-changing the group to which the file belongs
chmod-changing the file mode
chown-changing the owner of a file
clearstatcache-clearing the file state cache
copy-Copy Files
delete-See unlink () or unset ()
dirname-returns the directory portion of the path
disk_free_space-returns the free space in the directory
disk_total_space-returns the total disk size of a directory
Alias for Diskfreespace-disk_free_space ()
fclose-Close an open file pointer
feof-Test If the file pointer is at the end of the file
fflush-output buffered content to a file
fgetc-reading characters from the file pointer
Fgetcsv-reads a row from the file pointer and resolves the CSV field
fgets-reading a line from the file pointer
Fgetss-reads a row from the file pointer and filters out HTML tags
file_exists-checking whether a file or directory exists
file_get_contents-to read the entire file into a string
file_put_contents-writing a string to a file
file-to read an entire file into an array
Fileatime-last access time of the file
filectime-this php file function to get the inode modification time of the file
filegroup-get the group of files
fileinode-obtaining the Inode of the file
filemtime-Get File modification time
Fileowner-get the owner of the file
fileperms-permission to obtain a file
filesize-Get File size
filetype-getting the file type
flock-Lightweight consultation document lock-up
fnmatch-matching file name with pattern
fopen-Open File or URL
fpassthru-all remaining data at the output file pointer
fputcsv-format the row as CSV and write the file pointer
Alias for Fputs-fwrite ()
fread-read files (can be used safely in binary files)
fscanf-formatting input from a file
fseek-positioning in the file pointer
fstat-obtaining file information from an open file pointer
ftell-returns the position of the file pointer read/write
ftruncate-truncates a file to a given length
fwrite-writing files (can be used safely in binary files)
glob-looking for file paths that match the pattern
is_dir-the PHP file function to determine whether a given file name is a directory
is_executable-to determine if the given file name is executable
is_file-determine if the given file name is a normal file
is_link-determines whether a given file name is a symbolic connection
Is_readable-to determine whether a given file name is readable
is_uploaded_file-to determine if the file was uploaded via HTTP POST
Is_writable-determines whether a given file name can be written
Alias for Is_writeable-is_writable ()
link-Establish a hard connection
Linkinfo-get information on a connection
Lstat-gives information about a file or symbolic connection
mkdir-New Directory
Move_uploaded_file-moving uploaded files to a new location
parse_ini_file-parsing a configuration file
pathinfo-return the file path information
pclose-closing Process file pointers
popen-opening a process file pointer
readfile-output a file
readlink-returns the target to which the symbolic connection is pointing
realpath-returns the normalized absolute path name
rename-renaming a file or directory
Rewind-Rewind the position of the file pointer
rmdir-Deleting a directory
Alias for Set_file_buffer-stream_set_write_buffer ()
Stat-give the information of the file
symlink-establishing symbolic connections
tempnam-to create a file with a unique file name
tmpfile-Creating a temporary file
touch-setting file access and modification times
umask-Change the current umask
unlink-Deleting files

Of course, some PHP file functions like just said there, it is impossible to use, remember a few commonly used on OK, at least I think so. Take a look at the simple use of some of these key functions from the beginning of the next section. In WordPress We see the first file handler function is Dirname:require_once (dirname (__file__). '/wp-load.php '); basically in WP, the path to the file uses an absolute path!


http://www.bkjia.com/PHPjc/446071.html www.bkjia.com true http://www.bkjia.com/PHPjc/446071.html techarticle for from now on I will learn about the PHP file processing related knowledge to record down, share! I think any kind of programming language inevitably has to deal with the file system, so in P ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.