[PHP] Re: include file to global scope

2005-10-14 Thread Oliver Grätz
Claudio schrieb: > I'm using PHP 5. I have a class operation that includes php files. > Is there a way to include this files to global scope? So that difined vars > and functions are global accesseble? I know this problem from my early PHP days. If your problem is that you want to include some c

[PHP] Re: include file to global scope

2005-10-13 Thread cc
the answer 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(); > } is

Re: [PHP] Re: include file to global scope

2005-10-13 Thread Jochem Maas
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 f

[PHP] Re: include file to global scope

2005-10-12 Thread cc
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(); } of course, you may extend this function to bet