Skip to content

Instantly share code, notes, and snippets.

@samir64
Created April 28, 2018 15:29
Show Gist options
  • Save samir64/25decea21b8c40594e6ee504222ee32f to your computer and use it in GitHub Desktop.
Save samir64/25decea21b8c40594e6ee504222ee32f to your computer and use it in GitHub Desktop.
A simple function to import file instead require or include
<?php
function import($caller_file, $package, $script) {
require_once(realpath(dirname($caller_file) . "/" . $package . "/" . $script));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment