Re: Re: include file to global scope

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



cc wrote:
yes, its possible, consider this:

/**
 * @param $file_to_include path to php file you want to get its content
 * @return included contents
 */
function get_output($file_to_include){
  ob_start();
  include $file_to_include;
  return ob_get_clean();
}

this will break if the included file assumes its being included
in the global scope (and/or has functions that assume certain globals
exists - which they would do if the file wasn't included within a
function) ...

which brings the OP back to his original problem :-)


of course, you may extend this function to better fit into your situation.
Good luck.

On 10/12/05, Claudio <karfunckel-php@xxxxxxxx> wrote:

Is it possible to process the file in second php instance?
An only get its output?

Claudio

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux