1. Go to this page and download the library: Download noki/xml-converter library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
noki / xml-converter example snippets
use Noki\XmlConverter\Convert;
$json = Convert::xmlToJson($xmlString);
$array = Convert::xmlToArray($xmlString);
$array = Convert::xmlToArray(
$xmlString,
namespace_in_tag_name: true,
is_cdata: true,
schema_path: '/path/to/schema.xsd' // or '' to enable DTD validation
);