Basic PHP problems -
when use function variables created included scripts retained within scope of function.
function reqscript($script) { $include_dir = 'inc/'; $page_ext = '.php'; include($include_dir.$script.$page_ext); }
is there way of me not having use following method?
include(buildfilename('...'));
if want define variables in included file, have use $globals
.
e.g: $foobar = 42;
should $globals['foobar'] = 42;
so $foobar
available in global scope (outside of functions).
but prefer buildfilename()
method.
Comments
Post a Comment