Is it possible to guess the absolute path of a relative path that I have specified for loading a XML file? This is my coding:
$strXML = __DIR__ . "/../xml/file.xml";
$xmlFile = simplexml_load_file($strXML);
$strPath = fullPathFunction($xmlFile); //Desired function
You can use realpath
function:
$strXML = "../xml/file.xml";
$xmlFile = simplexml_load_file($strXML);
$strPath = realpath($strXML);