I would like to load module and call Magento 2 function. e.g load magento 2 quote by id
You need to load Magento 2 Bootstrap from external file first. Here is an example
use Magento\Framework\App\Bootstrap; require __DIR__ . '/../app/bootstrap.php'; $bootstrap = Bootstrap::create(BP, $_SERVER); $obj = $bootstrap->getObjectManager(); $state = $obj->get('Magento\Framework\App\State'); $state->setAreaCode('frontend'); $quote = $obj->get('Magento\Checkout\Model\Session')->getQuote()->load(1);