function _fnc() { $args = func_get_args(); $path = "system/functions/"; if ($loc = strrpos($args[0], '/')) list($path, $func) = split('-l-', chunk_split($args[0], $loc+1, '-l-')); else $func = $args[0]; unset($args[0]); if (!function_exists($func)) include_once($path.$func.'.php'); return call_user_func_array($func, $args); } //this would be its own seperate page called do.php in system/functions/ function do($arg1, $arg2) { return $arg1 + $arg2; } //you call it this way _fnc("do", 1, 1);