The difference between include and require in PHP, Phpincluderequire
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:
1 functionR$file _name) {2 $filenum=@fopen($file _name, "R");3@Flock($filenum,lock_sh);4 $file _data=@fread($filenum,filesize($file _name));5@fclose($filenum);6 return $file _data;7 }8 functionW$file _name,$data,$method= "W"){9 $filenum=@fopen($file _name,$method);Ten Flock($filenum,lock_ex); One $file _data=fwrite($filenum,$data); A fclose($filenum); - return $file _data; -}
http://www.bkjia.com/PHPjc/1048763.html www.bkjia.com true http://www.bkjia.com/PHPjc/1048763.html techarticle The difference between include and require in PHP, Phpincluderequire include and require, in fact, there is not much difference between the two, if you want to include the file does not exist, include prompt notice, and then ...