What is the difference between PHP require and include?

mcmohanrtg

New Member
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:\[code\]require_once 'settings.php';\[/code\]and then in index.php, i wrote:\[code\]require_once 'settings.php';require_once 'database.php';\[/code\]so I load settings.php two times, is this okay? Any tips using these functions?
 
Back
Top