How to call header and footer in custom script page? We need to call the header and footer for the root file.
You can check this link :
But why would anyone do that ? you can create a module where you can create a page with header and footer, you can add all thing which you wanted in php file and additional Magento features.
Check this link how you can create a new page in magento 2 :