Sample code for 30+ languages & platforms
PHP

Load XML from Local FilePath

Demonstrates how to load XML from a local XML file.

Chilkat PHP Downloads

Chilkat2 PHP
<?php

use Chilkat2\Xml;

$xml = new Xml();

// Pass either an absolute file path, or a file path relative from the current working directory of the caller.
try {
    $xml->LoadXmlFile('qa_data/hamlet.xml');
} catch (\Chilkat2\Exception $e) {
    echo $e->getMessage(), "\n";
    exit;
}

echo "Success.\n";