SimpleXML Example Output:

CountryCapitalTime ZoneTimeCurrencyLocal DomainDial Codes
Algeria (People’s Democratic Republic of Algeria)Algiers+1 GMT6:13Algerian dinar
Bahrain (Kingdom of Bahrain)Manama+3 GMT8:13Bahraini dinar
Djibouti (Republic of Djibouti)Djibouti+3 GMT8:13Djiboutian franc
Egypt (Arab Republic of Egypt)Cairo+2 GMT7:13Egyptian pound
Iraq (Republic of Iraq)Bagdād+3 GMT8:13Iraqi dinar
Jordan (Hashemite Kingdom of Jordan)Ammān+2 GMT7:13Jordanian dinar
Kuwait (State of Kuwait)Al-Kuwayt+3 GMT8:13Kuwaiti dinar
Lebanon (Lebanese Republic)Bayrūt+3 GMT8:13Lebanese lira
Libya (Libya)Tripoli+2 GMT7:13Libyan dinar
Mauritania (Islamic Republic of Mauritania)Nouakchott0 GMT5:13Mauritanian ouguiya
Morocco (Kingdom of Morocco)Rabat0 GMT5:13Moroccan dirham
Oman (Sultanate of Oman)Muscat+4 GMT9:13Omani rial
Palestine (Palestinian National Authority)Jerusalem+2 GMT7:13US Dollar
Qatar (State of Qatar)Doha+3 GMT8:13Qatari riyal
Saudi Arabia (Kingdom of Saudi Arabia)Riyadh+3 GMT8:13Saudi riyal
Somalia (Somali Republic)Muqdisho+3 GMT8:13Somali shilling
Sudan (Republic of the Sudan)Khartoum+2 GMT7:13Sudanese pound
Syria (Syrian Arab Republic)Damascus+2 GMT7:13Syrian pound
Tunisia (Republic of Tunisia)Tunis+1 GMT6:13Tunisian dinar
UAE (United Arab Emirates)Abu Dhabi+4 GMT9:13United Arab Emirates dirham
Yemen (Republic of Yemen)Şan'ā+3 GMT8:13Yemeni rial

SimpleXML Example Code:

// set name of XML file
$file '/path/to/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';
'<a href="Info.php?lang=english">English</a>';
    } else {
$lang 'english';
$dir  'ltr';
'<a href="Info.php?lang=arabic">Arabic</a>';
'<table width="98%" cellpadding="5" cellspacing="2" dir="'.$dir.'">';

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

$lat substr($country->capital->latitude0, -3);
substr($country->capital->latitude, -1) == 'S'$lat = -$lat;
$lon substr($country->capital->longitude0, -3);
substr($country->capital->latitude, -1) == 'W'$lon = -$lon;

'<td><a href="'.$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

'<td>'.$timezone.' GMT</td>';
'<td><a href="'.$country->currency->iso.'" target="_blank">'
'<td><a href="'.strtolower($country->iso3166->a2).'.php" target="_blank">

$xml null;

Total execution time is 0.00583815574646 seconds
Amount of memory allocated to this script is 257240 bytes

Names of included or required files: