The difference between include and require, in fact, there is not much difference between the two, if the file to be included does not exist, include prompt notice, and then continue to execute the following statement, require prompt fatal error and exit.
According to the test, they are all included after the Win32 platform, so the included file is best not to have include or require statements, which will cause the directory confusion.
Perhaps *nux under different circumstances, not yet tested. If a file does not want to be included multiple times can be read using include_once or require_once##, write the document data:
1functionR$file _name) {2$filenum=@fopen($file _name, "R");3@Flock($filenum,lock_sh);4$file _data=@fread($filenum,filesize($file _name));5@fclose($filenum);6return$file _data;7}8functionW$file _name,$data,$method= "W"){9$filenum=@fopen($file _name,$method);TenFlock($filenum,lock_ex); One$file _data=fwrite($filenum,$data); Afclose($filenum); -return$file _data; -}
The above introduces the differences between include and require in PHP, including the contents of the content, I hope that the PHP tutorial interested in a friend helpful.