X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=blobdiff_plain;f=file_run.php;h=e5016688c514b09b61a1b944fc70cc09ea36ebf0;hp=e17779774d51404e1aa2ab2d9e32c4946618970b;hb=56892b42cb4895e601c8de375d833806772673e9;hpb=8abf94f3526d4c1a7fa846b72a0ce64e0d2d03db 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); + } } ?>