PHP Classes

File: examples/convert_string.php

Recommend this page to a friend!
  Classes of Temuri Takalandze   PHP XML to JSON Conversion   examples/convert_string.php   Download  
File: examples/convert_string.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP XML to JSON Conversion
Convert a XML document into a JSON string
Author: By
Last change:
Date: 3 years ago
Size: 479 bytes
 

Contents

Class file image Download
<?php

/*
 * This file is part of the abgeo/xml-to-json.
 *
 * Copyright (C) 2020 Temuri Takalandze <takalandzet@gmail.com>.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

use ABGEO\XmlToJson\StringConverter;

require
__DIR__ . '/../vendor/autoload.php';

$converter = new StringConverter();
$xmlContent = file_get_contents(__DIR__ . '/example.xml');

echo
$converter->convert($xmlContent);