require_once

require_once

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

require_once 表達式和 require 表達式完全相同,唯一區別是 PHP 會檢查該檔案是否已經被包含過,如果是則不會再次包含。

參見 include_once 的文件來理解 _once 的含義,並理解與沒有 _once 時候有什麼不同。

Leave a Reply

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