define my own BASE_PATH vs. set_include_path?
问题 I learned of the function set_include_path(). All this time, I defined a constant in the config.php file define('BASE_PATH', '/var/www/mywebsite/public_html/'); And in all subsequent php files, I would include like so include(BASE_PATH.'header.php'); include(BASE_PATH.'class/cls.data_access_object.php'); Is there any advantage with the constant approach vs. the set_include_path approach and vice versa? Is the constant approach obsolete? 回答1: Using set_include_path() (or ini_set('include_path'