If I have this:
require_once('myfile.php');
then later:
include_once('myfile.php');
Will the file get included again or just the once?
Also what is the difference between the two? Require causes an error on failure and include tries to recover? any other differences?
If the file is included, it is included.
requice_once()
works exactly like include_once()
, except that it kills the script when the script to include is not found.
Therefore in your example, the script is included once.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With