title: Can I include an element from an xml file with php?
body: <p>I have a list, consisting of links looking like this:</p>
  
  <pre><code>&lt;a href=index.php?p=page_1&gt;Page 1&lt;/a&gt;
  &lt;a href=index.php?p=page_2&gt;Page 2&lt;/a&gt;
  &lt;a href=index.php?p=page_3&gt;Page 3&lt;/a&gt;
  </code></pre>
  
  <p>When clicked they include a page (page_1.inc.php or page_2.inc.php or page_3.inc.php) on my page thanks to this script:</p>
  
  <pre><code>&lt;?php
    $pages_dir = 'pages';
  
    if(!empty($_GET['p'])){
        $pages = scandir($pages_dir, 0);
        unset($pages[0], $pages[1]);
  
        $p = $_GET['p'];
  
        if (in_array($p.'.inc.php', $pages)){
            include ($pages_dir.'/'.$p.'.inc.php');
        }
        else {
            echo 'Sorry, could not find the page!';
        }
    }
    else {
        include($pages_dir.'/home.inc.php');
    }
  ?&gt;
  </code></pre>
  
  <p>Period.
  <br />
  I also have an xml file looking like this:</p>
  
  <pre><code>&lt;program&gt;
      &lt;item&gt;
          &lt;date&gt;27/8&lt;/date&gt;
          &lt;title&gt;Page 1&lt;/title&gt;
          &lt;info&gt;This is info text&lt;/info&gt;
      &lt;/item&gt;
      &lt;item&gt;
          &lt;date&gt;3/9&lt;/date&gt;
          &lt;title&gt;Page 2&lt;/title&gt;
          &lt;info&gt;This is info text again&lt;/info&gt;
      &lt;/item&gt;
      &lt;item&gt;
          &lt;date&gt;10/9&lt;/date&gt;
          &lt;title&gt;Page 3&lt;/title&gt;
          &lt;info&gt;This just some info&lt;/info&gt;
      &lt;/item&gt;
  &lt;/program&gt;
  </code></pre>
  
  <p>This is what I want to achieve:<br />
  If I click on the link "Page 1" it will display "This is info text" on the page.<br />
  If I click on the link "Page 2" it will display "This is info text again" on the page.<br />
  If I click on the link "Page 3" it will display "This just some info" on the page.<br /></p>
  
  <p>Was I clear enough?
  Is there any solution for this?</p>