Re: Why php ?
Margaret Willmer schrieb:
Could you tell me however, if there is an advantage in using
"require_once" instead of "include".
Use require_once() or include_once() for including files with class or
function definitions, to avoid an error if the same file would be
included at some other place in your script.
Use require() or include() if you possibly want to include the same
piece of code more than once.
Use require() or require_once() to include code that is essential for
the functionality of the script (as failure of inclusion will cause the
script to exit with a fatal error).
Use include() or include_once() if you want the script to be continued
if the inclusion fails.
HTH
Markus
.
Relevant Pages
- Re: external functions
... I built a separate file with all the function definitions in it. ... I then made a script that executed the first script and then ... > Is it possible to define multiple shell functions in one file and use ... (comp.unix.shell) - Function to resize global numpy array interactively in ipython
... I have a script with function definitions which I load into ipython ... These functions modify a global numpy array, whose size I need to be ... If I run this in ipython, using "run resize.py", it correctly outputs ... (comp.lang.python) - Re: Programming Tips and Tricks
... >>included and evaluated more than once during a particular execution of a ... >>script, and you want to be sure that it is included exactly once to avoid ... >>Why would you include the same file multiple times in the same file anyway? ... If it is a set of function definitions or class ... (comp.lang.php) - Re: External file forJavaScript
... If it contains only function definitions, then you might need to do ... Did you get any instructions with the script? ... > It's an hotel search box which obviously has a lot of JavaScript in it and ... I need to use an external file for my JavaScript ... (microsoft.public.frontpage.client) - Re: Why php ?
... function definitions, to avoid an error if the same file would be included at some other place in your script. ... Use requireor require_onceto include code that is essential for the functionality of the script. ... Use includeor include_onceif you want the script to be continued if the inclusion fails. ... (alt.php) |
|