windowsZones->mapTimezones->mapZone,0); foreach ($zones as $zone) { $wz = (string) $zone['other']; $terr = (string) $zone['territory']; $tzmapping[$wz][$terr] = (string) $zone['type'];; } //var_dump($tzmapping); // produce code to set up the array for php to check values against $phptext = '$terr) { foreach ($terr as $t=>$tz) { //$phptext .= '$wz["'.$z.'"]["'.$t.'"] = "'.$tz.'";'.PHP_EOL; // not using territories now - keep it simpler $phptext .= '$wz["'.$z.'"] = "'.$tz.'";'.PHP_EOL; break; } } $filename = 'WindowsZonesToTimeZones.txt'; // ideally if in wordpress save somewhere one has access to $result = file_put_contents ( $filename //string $filename ,$phptext //mixed $data [ , LOCK_EX //int $flags = 0 [ //, //resource $context ]] ); if ($result) { ?>
If permissions prevent updating the file, you can run this script on any server and/or change the filename and then move it to the plugins timezones folder. It only needs to be updated in the possibly unlikley event that windows or unicode.org change the mappings.
Full mapping loaded, but currently only using first territory of each, only the first was written.
php