PHP code example of blvckgvd / xml_lib
1. Go to this page and download the library: Download blvckgvd/xml_lib 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/ */
blvckgvd / xml_lib example snippets
use Blvckgvd\XmlLib\XmlLib;
public function getArrayFromXml() {
$json = XmlLib::toJson('<path to xml>');
return $json;
}
// will return json
use Blvckgvd\XmlLib\XmlLib;
public function getArrayFromXml() {
$arr = XmlLib::toArray('<path to xml>');
return $arr;
}
// will return array