View Single Post
Old 06-21-2010, 04:37 PM   #4 (permalink)
tony
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

you can use include to save the return content of a document. the manual gives an example:
php Code:
return.php
<?php

$var = 'PHP';

return $var;

?>

noreturn.php
<?php

$var = 'PHP';

?>

testreturns.php
<?php

$foo = include 'return.php';

echo $foo; // prints 'PHP'

$bar = include 'noreturn.php';

echo $bar; // prints 1

?>

if you want the whole content and not just the return value of the file, you can always use file_get_contents

Another thing you might want to get into account here, is the performance too, specially if they are big files. You don't want them all to be hold in the memory if they are big.
tony is offline  
Reply With Quote