SimpleXML Example Output:

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

Names of included or required files: