note 67354 rejected from function.include by nlopess

From: Date: Wed, 07 Jun 2006 13:24:55 +0000
Subject: note 67354 rejected from function.include by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-113539@lists.php.net to get a copy of this message
Note Submitter: julien dot sebire at free dot fr ---- When trying to return a value from a remotely included php file, I spent a little time to figure out what it should produce. The english documentation says : "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)." The french translation says something like : "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 remote file has valid PHP start and end tags (as with any local file)." That means this remotely included file will work : <?php $var=array(1,2); print('<?php return '.var_export($var,true).'; ?>'); ?> => returns : Array { [0] => 1 [1] => 2 } While this one, suggested by the french documentation, won't work : <?php $var=array(1,2); return $var; ?> => returns : 1 (include succeed but no value returned) Hope this can help and maybe edit the french translation.

« previous php.notes (#113539) next »