SimpleXML Example Output:

Arabic
CountryCapitalTime ZoneTimeCurrencyLocal DomainDial Codes
Algeria (People’s Democratic Republic of Algeria)Algiers+1 GMT11:07Algerian dinarhttp://www.example.com.dz+213
Bahrain (Kingdom of Bahrain)Manama+3 GMT13:07Bahraini dinarhttp://www.example.com.bh+973
Djibouti (Republic of Djibouti)Djibouti+3 GMT13:07Djiboutian franchttp://www.example.com.dj+253
Egypt (Arab Republic of Egypt)Cairo+2 GMT12:07Egyptian poundhttp://www.example.com.eg+20
Iraq (Republic of Iraq)Bagdād+3 GMT13:07Iraqi dinarhttp://www.example.com.iq+964
Jordan (Hashemite Kingdom of Jordan)Ammān+2 GMT12:07Jordanian dinarhttp://www.example.com.jo+962
Kuwait (State of Kuwait)Al-Kuwayt+3 GMT13:07Kuwaiti dinarhttp://www.example.com.kw+965
Lebanon (Lebanese Republic)Bayrūt+2 GMT12:07Lebanese lirahttp://www.example.com.lb+961
Libya (Libya)Tripoli+2 GMT12:07Libyan dinarhttp://www.example.com.ly+218
Mauritania (Islamic Republic of Mauritania)Nouakchott0 GMT10:07Mauritanian ouguiyahttp://www.example.com.mr+222
Morocco (Kingdom of Morocco)Rabat0 GMT10:07Moroccan dirhamhttp://www.example.com.ma+212
Oman (Sultanate of Oman)Muscat+4 GMT14:07Omani rialhttp://www.example.com.om+968
Palestine (Palestinian National Authority)Jerusalem+2 GMT12:07US Dollarhttp://www.example.com.ps+970
Qatar (State of Qatar)Doha+3 GMT13:07Qatari riyalhttp://www.example.com.qa+974
Saudi Arabia (Kingdom of Saudi Arabia)Riyadh+3 GMT13:07Saudi riyalhttp://www.example.com.sa+966
Somalia (Somali Republic)Muqdisho+3 GMT13:07Somali shillinghttp://www.example.com.so+252
Sudan (Republic of the Sudan)Khartoum+2 GMT12:07Sudanese poundhttp://www.example.com.sd+249
Syria (Syrian Arab Republic)Damascus+2 GMT12:07Syrian poundhttp://www.example.com.sy+963
Tunisia (Republic of Tunisia)Tunis+1 GMT11:07Tunisian dinarhttp://www.example.com.tn+216
UAE (United Arab Emirates)Abu Dhabi+4 GMT14:07United Arab Emirates dirhamhttp://www.example.com.ae+971
Yemen (Republic of Yemen)Şan'ā+3 GMT13:07Yemeni rialhttp://www.example.com.ye+967

SimpleXML Example Code:

<?php
    
// set name of XML file
    
$file '../src/data/ar_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="../src/data/flags/'.$country->name->english.'.svg" target="_blank">'.$country->name->$lang.'</a>';
        echo 
' ('.$country->longname->$lang.')</td>';

        
$lat $country->capital->latitude;
        
$lon $country->capital->longitude;

        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>http://www.example.com.'.strtolower($country->iso3166->a2).'</td>';
        echo 
'<td>+'.$country->dialcode.'</td>';
        echo 
'</tr>';
    }

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