1. File Handling functions
File_get_contents ()//Get the contents of a File/network resource
Faster functions with internal encapsulation of open/close operations
But because in fact, the contents of the file read all, for large files with caution
File_put_contents (' file ', content)//write content to file
If the file does not exist, it is created automatically
fopen (' file ', ' mode ')//Open a file, return a resource
R Read-only
r+ read-write, pointer overwrite write from file header
W Write, will clear first
A append mode, pointer in the last
Fread (resource, length)//Read the contents of a resource
Fwrite (resources, content)//write content to
Fclose (resources)//Close Resources
Fgets (Resource)//read a line of content, read the pointer down one line
Feof ()//Determine if the pointer is in the last row
File (Resource)//reads the contents of the files and splits them into arrays by rows, returning the data
Use caution for large files
Filemtime ()//File modification time
FileSize ()//Read File size
Unlink ()//delete files
2. Import the CSV file
When you need to enter the contents of the XLS file into the database, you can save it as a CSV file first
Fgetcsv () takes a row from the file pointer
The relevant specifications for the CSV file have been encapsulated, even though the CSV file has some
Special cases (such as blank lines, commas between fields, etc.), can also operate normally
3. Directory Operations
Opendir ()//Open Readdir ()//Read closedir ()//Off
Is_dir ()//whether directory mkdir ()//Create RMDIR ()//delete (only non-empty)
mkdir (' directory ', 0777,true); Turn on recursive creation
@zhnoah
Source: http://www.cnblogs.com/zhnoah/
This article is owned by me and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original
The right to pursue legal liability.
PHP Learning note--8. Files and directories