ディレクトリ内のすべてのxmlファイルを見つけて日付を取得するこのコードがあります。しかし、代わりに、ディレクトリ内の各xmlファイルの各行をエコーしたいです。xmlファイルは次のようになります
<event> 
<day>11</day> 
<month>01</month> 
<year>2013</year> 
<link>link</link> 
<title>Title</title> 
<description></description>
</event>
そして私のphpコード
$events = array();
// open each xml file in this directory
foreach(glob("*.xml") as $filename) {   
    // get the contents of the the current file
    $xml_file = file_get_contents($filename, FILE_TEXT);
    // create a simplexml object from the contents of the current file
    $xml = simplexml_load_string($xml_file);
    // create a day, link, description, etc.
    $eventDay = (int)$xml->day;
    $eventMonth = (int)$xml->month;
    $eventYear = (int)$xml->year;
    $eventLink = (string)$xml->link;
    $eventDesc = (string)$xml->description;
    if($eventMonth == $month && $eventYear == $year)        
        $events[$eventDay] = array($eventLink,'linked-day');
}
return $events;
}
たとえば、見つかったファイルごとに、次のようなものが出力されます
 <div class="event"><p>Date: month/day/year</p><p>Title: the xml title</p><p>description: the xml description</p></div>