X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=file_run.php;h=e5016688c514b09b61a1b944fc70cc09ea36ebf0;hb=eecd5e3576866afc8091abe9b74352130fd8e6cc;hp=e17779774d51404e1aa2ab2d9e32c4946618970b;hpb=8abf94f3526d4c1a7fa846b72a0ce64e0d2d03db;p=wfpl.git diff --git a/file_run.php b/file_run.php index e177797..e501668 100644 --- a/file_run.php +++ b/file_run.php @@ -1,22 +1,19 @@ -. # This function makes it easier to put everything in functions like you should. @@ -36,11 +33,14 @@ # return array('me', 'secret'); # } -function file_run($filename) { +function file_run($filename /* args... */) { + $args = array_slice(func_get_args(), 1); require_once($filename); $func = basename($filename, '.php') . '_main'; - return $func(); + if(function_exists($func)) { + return call_user_func_array($func, $args); + } } ?>