difference between require, require_once and register

hi every body .

i want to know "difference between require, require_once and  register "  for Security code of my system & Speed System .

my result search :

 

require 'file1': It will include the code of the file1. In case file1 does not exist it will generate a fatal error and script will stop executing further.
require_once 'file1' : It works the same way. The only difference between require and require_once is that require_once does not include and evaluates file again if it has been included earlier

So, require_once() is recommended to use when you want to include a file where you have a lot of functions for example.
functions for example. This way you make sure you don't include the file more times and you will not get the "function re-declared" error

Difference between require() and require_once(): :

require() ==> includes and evaluates a specific file,
while require_once() ===> does that only if it has not been included before (on the same page).

AND I WILL BE HAPPY  if help me know more details AND  difference between  require_once and  elgg_load_library ??? 

thanks :)

 

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking