require

require

(PHP 4, PHP 5, PHP 7, PHP 8)

requireinclude 幾乎完全一樣,除了處理失敗的方式不同之外。require 在出錯時產生 E_COMPILE_ERROR 級別的錯誤。換句話說將導致指令碼中止而 include 只產生警告(E_WARNING),指令碼會繼續執行。

參見 include 文件瞭解詳情。

Leave a Reply

Your email address will not be published. Required fields are marked *