php simpleXML_load_file
-
I want to read a external xml page to a wordpress page on my site.
I have removed the url temporary. Can someone help me how to implement this in wordpress<?php include ('render_xml_to_html.php'); $url = '..'; ?> <?php if(function_exists('render_xml_data')){ render_xml_data($url); }else{ echo null;//allows the page to continue rendering } ?>
<?php function render_xml_data($url){ $xml = simpleXML_load_file($url,"SimpleXMLElement",LIBXML_NOCDATA); ; foreach ($xml->CURSUSEXPORT ->CURSUSSEN -> CURSUS as $cursus) { echo '<div class="Cursus">'."\n"; echo '<h3>'.$cursus->CU_TITEL.'</h3>'."\n"; echo '<p><span class="category">Begin datum: </span>'.$cursus->CU_BEGINDATUM.'</p>'."\n"; echo '<p><span class="category">Locatie </span>'.$cursus->CU_CURSUSLOCATIE.'</p>'."\n"; echo '<p><span class="category">Maximun aantal plaatsen: </span>'.$cursus->CU_MAXIMUM_AANTAL_CURSISTEN.'</p>'."\n"; echo '<p><span class="category">Aantal vrije plaatsen: </span>'.$cursus->CU_AANTAL_VRIJE_INSCHRIJVINGEN.'</p>'."\n"; echo '<p><span class="category">Inschrijven: </span> voor cursus '.$cursus->CU_TITEL.' Klik <a href="https://nim.chainwisehosted.nl/extranet/modules/cursusplanner/cursusoverzichtcurr_popup.asp?Actionpl_Cursus=findHTML&Action=Nieuw&Titel_flt='.$cursus->CU_CURSUSCODE.'">Hier </a></p> </br>'."\n"; echo '</div><!--end Cursus einde-->'."\n"; } } ?>
- The topic ‘php simpleXML_load_file’ is closed to new replies.