I know the basic usage of PHP require, require once, include and include once. But I am confused about when I should use them.
Example: I have 3 files, eg: settings.php, database.php, and index.php.
In database.php file, i wrote:
require_once 'settings.php';
and then in index.php, i wrote:
require_once 'settings.php';
require_once 'database.php';
so I load settings.php two times, is this okay? Any tips using these functions?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…