Re: RES: [PHP] include into var

From: Date: Wed, 18 Oct 2000 20:47:43 +0000
Subject: Re: RES: [PHP] include into var
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-20981@lists.php.net to get a copy of this message
Carlos Henrique writes: > > > $content = include "file.php"; > > > print $content; > > > > > > It works fine. > > > > it does, but not for the reasons you think. > > > > include() returns nothing. it does no good to assign it to a > > variable. you could remove the print statement and the output > > would be the same. all you need is: > > > > include("path/to/my/file.php"); > > Just a quick correction: this is true for PHP 3, but not PHP 4. You can, indeed, return values from an included file in PHP 4. -- +----------------------------------------------------------------+ |Torben Wilson <torben@php.net> Netmill iTech| |http://www.coastnet.com/~torben http://www.netmill.fi| |Ph: 1 250 383-9735 torben@netmill.fi| +----------------------------------------------------------------+

« previous php.general (#20981) next »