UP PREVIOUS NEXT   Technologies Internet et Education, © TECFA
  3. Parsing avec "xmltree"

3. Parsing avec "xmltree"

Exemple 3-1: Extraction en format d'un arbre

 
 
<?php 
    $fd = fopen("test.xml","r"); 
    $myXML = fread($fd,filesize("test.xml")); 
    fclose($fd); 
    $docTree = xmltree($myXML);
    echo("<html><title>test</title><body>"); 
    echo("<h1>Vivian's test for xml dom for PHP</h1>"); 
    print("<pre>"); 
    print_r( $docTree ); 
    print( "</pre>" );
    echo("</body></html>"); 
?>  
 

UP PREVIOUS NEXT -- TIE