Thread: PHP Question
View Single Post
Old 05-18-07, 01:50 PM   #18
Join Date: Mar 2004
Posts: 15,486
Default Re: PHP Question

Originally Posted by fivefeet8
I think in your case, either require_once() or require() will work because you'd still only be calling one instance. Since all the functions you need will be located on a single php script. Maybe you think require_once() means you need to require the file again if you need the function again on the same page. Which isn't the case.

Require_once() simply checks to see if you've already included an instance. If you have, it will not include it again. If you haven't, it will include it. Require() does not check and will include an instance again no matter if you've already included it or not.

I only suggested require_once() because if the plan to extend into OOP programming later on, require() may cause errors if your classes reference other classes.
oh ok. yes i misunderstood the purpose of require_once()
ViN86 is offline   Reply With Quote