Charger le fichier XML selon l’API disponible

Author:

classes
Download

<?php

$classes = get_declared_classes();

if( in_array('SimpleXMLElement', $classes) ) {
    $xmldoc = simplexml_load_file('myfile.xml');

} elseif( in_array('DOMDocument', $classes) )
{
    $xmldoc = new DOMDocument();
    $xmldoc->load('myfile.xml');

} else {
}
?>

Leave a Reply

Your email address will not be published. Required fields are marked *


9 + = fifteen