SimpleXML Example Output:

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

Names of included or required files: