SimpleXML Example Output:

English
CountryCapitalTime ZoneTimeCurrencyLocal DomainDial Codes
الجزائر (الجمهورية الجزائرية الديمقراطية الشعبية)الجزائر+1 GMT2:37دينار جزائريhttp://www.example.com.dz+213
البحرين (مملكة البحرين)المنامة+3 GMT4:37دينار بحرينيhttp://www.example.com.bh+973
جيبوتي (جمهورية جيبوتي)جيبوتي+3 GMT4:37فرنك جيبوتيhttp://www.example.com.dj+253
مصر (جمهورية مصر العربية)القاهرة+3 GMT4:37جنيه مصريhttp://www.example.com.eg+20
العراق (جمهورية العـراق)بغداد+4 GMT5:37دينار عراقيhttp://www.example.com.iq+964
الأردن (المملكة الأردنية الهاشمية)عمان+3 GMT4:37دينار أردنيhttp://www.example.com.jo+962
الكويت (دولة الكويت)الكويت+3 GMT4:37دينار كويتيhttp://www.example.com.kw+965
لبنان (الجمهورية اللبنانية)بيروت+3 GMT4:37ليرة لبنانيةhttp://www.example.com.lb+961
ليبيا (ليبيا)طرابلس+2 GMT3:37دينار ليبيhttp://www.example.com.ly+218
موريتانيا (الجمهورية الإسلامية الموريتانية)نواكشوط0 GMT1:37أوقية موريتانيةhttp://www.example.com.mr+222
المغرب (المملكة المغربية)الرباط+1 GMT2:37درهم مغربيhttp://www.example.com.ma+212
عمان (سلطنة عمان)مسقط+4 GMT5:37ريال عمانيhttp://www.example.com.om+968
فلسطين (السلطة الفلسطينية)القدس+2 GMT3:37دولار أمريكيhttp://www.example.com.ps+970
قطر (دولة قطر)الدوحة+3 GMT4:37ريال قطريhttp://www.example.com.qa+974
السعودية (المملكة العربية السعودية)الرياض+3 GMT4:37ريال سعوديhttp://www.example.com.sa+966
الصومال (جمهورية الصومال)مقديشو+3 GMT4:37شلن صوماليhttp://www.example.com.so+252
السودان (جمهورية السودان)الخرطوم+2 GMT3:37جنيه سودانيhttp://www.example.com.sd+249
سوريا (الجمهورية العربية السورية)دمشق+3 GMT4:37ليرة سوريةhttp://www.example.com.sy+963
تونس (الجمهورية التونسية)تونس+1 GMT2:37دينار تونسيhttp://www.example.com.tn+216
الإمارات (الإمارات العربية المتحدة)أبو ظبى+4 GMT5:37درهم إماراتيhttp://www.example.com.ae+971
اليمن (الجمهورية اليمنية)صنعاء+3 GMT4:37ريال يمنيhttp://www.example.com.ye+967

SimpleXML Example Code:

<?php
    // set name of XML file
    $file = '../data/arab_countries.xml';
    
    // load XML file
    $xml = simplexml_load_file($file) or die ('Unable to load XML file!');

    if ($_GET['lang'] == 'arabic') {
        $lang = 'arabic';
        $dir  = 'rtl';
        echo '<a href="Info.php?lang=english">English</a>';
    } else {
        $lang = 'english';
        $dir  = 'ltr';
        echo '<a href="Info.php?lang=arabic">Arabic</a>';
    }
    
    echo '<table width="98%" cellpadding="5" cellspacing="2" dir="'.$dir.'">';

    echo '<tr>';
    echo '<td><b><u>Country</u></b></td>';
    echo '<td><b><u>Capital</u></b></td>';
    echo '<td><b><u>Time Zone</u></b></td>';
    echo '<td><b><u>Time</u></b></td>';
    echo '<td><b><u>Currency</u></b></td>';
    echo '<td><b><u>Local Domain</u></b></td>';
    echo '<td><b><u>Dial Codes</u></b></td>';
    echo '</tr>';
    
    // iterate over <country> element collection
    foreach ($xml as $country) {
        echo ($i++ % 2)? '<tr bgcolor="#F5F5F5">' : '<tr bgcolor="#E5E5E5">';
        
        echo '<td><a href="../images/flags/'.$country->name->english.'.svg" target="_blank">'.$country->name->$lang.'</a>';
        echo ' ('.$country->longname->$lang.')</td>';

        $lat = substr($country->capital->latitude, 0, -3);
        if(substr($country->capital->latitude, -1) == 'S') $lat = -1 * $lat;
        
        $lon = substr($country->capital->longitude, 0, -3);
        if(substr($country->capital->latitude, -1) == 'W') $lon = -1 * $lon;

        echo '<td><a href="http://maps.google.com/maps?ll='.$lat.','.$lon.'&t=h&z=10" target="_blank">'.$country->capital->$lang.'</a></td>';

        $timezone = $country->timezone;
        if ($country->summertime['used'] == 'true') {
            $start = strtotime($country->summertime->start);
            $end   = strtotime($country->summertime->end);
            if (time() > $start && time() < $end) {
                $timezone = $timezone + 1;
                $timezone = '+' . $timezone;
            }
        }
        
        // convert current time to GMT based on time zone offset
        $gmtime = time() - (int)substr(date('O'),0,3)*60*60; 

        echo '<td>'.$timezone.' GMT</td>';
        echo '<td>'.date('G:i', $gmtime+$timezone*3600).'</td>';
        echo '<td><a href="http://www.xe.com/ucc/convert.cgi?Amount=1&From=USD&To='.$country->currency->iso.'" target="_blank">'
                  .$country->currency->$lang.'</a></td>';
        echo '<td><a href="http://www.101domain.com/whois-'.strtolower($country->iso3166->a2).'.php" target="_blank">
                  http://www.example.com.'.strtolower($country->iso3166->a2).'</a></td>';
        echo '<td>+'.$country->dialcode.'</td>';
        echo '</tr>';
    }

    echo '</table>';
    $xml = null;

Total execution time is 0.0019369125366211 seconds
Amount of memory allocated to this script is 381416 bytes

Names of included or required files: