diff between include and require_once()
Posted: Tue Aug 26, 2003 10:23 am
anyone?? whats the difference between the two.??
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
yeshttp://php.net/require_once wrote: The require_once() statement includes and evaluates the specified file during the execution of the script. This is a behavior similar to the require() statement, with the only difference being that if the code from a file has already been included, it will not be included again. See the documentation for require() for more information on how this statement works.
Er.. no. volka had it right, but he forgot to correct you on that one. If you require() a file twice in the same page, it will be parsed twice. If you require_once() a page twice, it will be parsed the first time, and ignored the second time.the way I see it is, require_once will only include the document once and never parse it again, where as a require will (like include) be parsed each time teh page is loaded.. and ya the error handeling is differant.
is that correct?