SimpleXML Example Output:

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

Names of included or required files: