#!/usr/bin/env php strings[' . $match . '] = ' . $match . ';' . "\n"; } } } if (count($matchestt)) { foreach ($matchestt[1] as $match) { $matchtkns = preg_split("|[ \t\r\n]*,[ \t\r\n]*|", $match); if (count($matchtkns) == 3 && !in_array($matchtkns[0], $arr)) { if (substr($matchtkns[1], 0, 1) == '$') { continue; } $arr[] = $matchtkns[0]; $s .= '$a->strings[' . $matchtkns[0] . "] = array(\n"; $s .= "\t0 => " . $matchtkns[0] . ",\n"; $s .= "\t1 => " . $matchtkns[1] . ",\n"; $s .= ");\n"; } } } } $s .= '// Timezones' . PHP_EOL; $zones = timezone_identifiers_list(); foreach ($zones as $zone) { $s .= '$a->strings[\'' . $zone . '\'] = \'' . $zone . '\';' . "\n"; } echo $s; function glob_recursive($path) { $dir_iterator = new RecursiveDirectoryIterator($path); $iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::SELF_FIRST); $return = []; foreach ($iterator as $file) { if ($file->getBasename() != '.' && $file->getBasename() != '..') { $return[] = $file->getPathname(); } } return $return; }