include().
Posted: Wed Aug 08, 2007 7:57 pm
Does include return the file's contents?
For example:
What would $var equal?
For example:
Code: Select all
$var = include('somethingfile');
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$var = include('somethingfile');
http://de2.php.net/include wrote:Handling Returns: It is possible to execute a return() statement inside an included file in order to terminate processing in that file and return to the script which called it. Also, it's possible to return values from included files. You can take the value of the include call as you would a normal function. This is not, however, possible when including remote files unless the output of the remote file has valid PHP start and end tags (as with any local file). You can declare the needed variables within those tags and they will be introduced at whichever point the file was included.