Title: php  simpleXML_load_file
Last modified: September 1, 2016

---

# php simpleXML_load_file

 *  [magaraves](https://wordpress.org/support/users/magaraves/)
 * (@magaraves)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/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.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [render](https://wordpress.org/support/topic-tag/render/)
 * [simplexmlelement](https://wordpress.org/support/topic-tag/simplexmlelement/)
 * [xml](https://wordpress.org/support/topic-tag/xml/)

 * 0 replies
 * 1 participant
 * Last reply from: [magaraves](https://wordpress.org/support/users/magaraves/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/php-simplexml_load_file/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
