This is my study in the process of PHP notes, in order to be able to have a good learning habits, but also for the vast number of programming enthusiasts a learning reference, special to share the study notes, I hope for themselves and everyone can help. This study material is mainly from the Lamp brothers in detail php,php5 Chinese manual and online information, strongly recommend to learn PHP friends choose the lamp brother of "to elaborate PHP"
File Judgment function
Is_dir ()
Is_executable () to determine whether an executable file
Is_file ()
Is_link () Determine if the file name is a symbolic connection
Is_readable ()
Is_uploader_fiel () Determine if the file was uploaded via HTTP post
Is_writable ()
File properties
File_exists ()
FileSize ()
Is_readable ()
Is_writeable ()
Filectime ()
Filemtime ()
Fetch file name basename ()
Fetch directory DirName ()
File path information PathInfo ()
Create a file Touch ($file)
Delete File unlink ($file)
Move file (rename file) rename ("Current file path", "Destination file path")
Copy the file copy ("File name", "path")
Read and write files
File_get_contents ()
File_put_contents ()
fopen ("URL", Mode)
Various modes:
R: Read-only mode open file r+: Read and write mode W: write-only mode open, if the file does not exist, then new, if the file has content, then overwrite w+: Read and write mode A: write-only mode open, if the file does not exist, then new, if the file already has content, add a A +: Read T: Open file in text mode
Fread ()//reads the specified length of characters; Fread ("$file", FileSize ("Text.txt"))
FGETC ()//read one character at a time from the file;
Fgets ()//reads one line of characters from a file at a time;
Feof ($file)//Error reading the file or returning to the end of the file true
Write file
Fwrite ()
Move pointer inside file
Ftell ($file)//return current pointer position
Fseek ($file, 100, constant)//move file pointer
Rewind ()
basename (file path [, file suffix name]) Gets the file name, the second parameter is the PathInfo (file path) to parse the current path, returns an associative array, referenced by dirname,basename,extension Realpath (file relative path) displays the file absolute path filesize ($file) calculates the file size Fileatime ($file) shows the last visited time Filectime ($file) file settling time Filemtime ($file ) file last update fileperms () returns the file attributes and Permissions Fileowner () get the file owner
Directory Operations:
Opendir () Readdir () Closedir () Rewinddir ()//pointer returns the first table of contents