How can I force the execution of a PHP file in a global scope? -
i have php file, include.php has following contents:
<?php $myvar = "foo"; ?>
now, want create class, called globalinclude, can include file in global scope:
class globalinclude { public function include( $file="include.php" ) { #do smart include $file #do smart } }
in it's current form, $myvar variable available inside scope of include function. want like:
globalinclude::include( "include.php" ); echo $myvar;
output foo
any ideas on how can accomplish this?
Comments
Post a Comment