How to make require_once work and apply from within a function?
$myfile = "myfile";
function getFunctions($file) {
require_once("$file.php"); // twist.php has definition of jpegToHex()
}
getFunctions($myfile);
var_dump(jpegToHex("local.jpg")); // error
I have a loader, which loads functions from another file. But I have no idea how to make require_once()
work outside of it’s scope. I need functions from included file.
Don’t ask why I make entire new function to do exactly same. It’s part of a bigger script.