Re: R: equivelant of ASP's #include file?
| From: | Jack Dempsey | Date: | Fri, 14 Sep 2001 22:42:59 +0000 |
| Subject: | Re: R: equivelant of ASP's #include file? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-67416@lists.php.net to get a copy of this message | ||
require will grab the file no matter what (if it exists), include can be used
in an if else construct.....there's probably megabytes of text on this
subject in the archives....
Christian Reiniger wrote:
> On Friday 14 September 2001 10:17, --- wrote:
> > There are 3 functions in php that works similar to #include:
> >
> > include("filename.ext"): include filename.ext and parse it like a php
> > file
> >
> > require("filename.ext"); like include, but it's included only one time,
> > if the code contains two require with the same file that file will be
> > included only one time, instead of include that will include it twice
>
> Wrong. include and require behave (almost?) identical in current PHP
> versions. In earlier versions require only took constant file names,
> while include could handle variable ones.
> What you mean is include_once() and require_once()
>
> > readfile("filename.ext"); read filename.ext and print it to the output,
> > don't parse it.
>
> --
> Christian Reiniger
> LGDC Webmaster (http://lgdc.sunsite.dk/)
>
> I saw God --------- and she was black.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net