Topic: Shorter Timezone script?
<?php
$timestamps = array(-12, -11, -10, -9.5, -9, -8.5, -8, -7, -6, -5, -4, -3.5, -3, -2, -1, 0, 1, 2, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 8, 9, 9.5, 10, 10.5, 11, 11.5, 12, 13, 14);
$tloc = array(-8 => ' PST', -7 => ' MST', -6 => ' CST', -5 => ' EST', -4 => ' AST', -3 => ' ADT', 0 => ' GMT', 1 => ' CET');
foreach( $timestamps as $stamp )
{
$selected = $user['timezone'] == $stamp ? ' selected="selected"' : '';
$loc = isset($tloc[ $stamp ]) ? $tloc[ $stamp ] : '';
echo str_repeat("\t", 7) . "<option value=\"{$stamp}\"{$selected}>{$stamp}{$loc}</option>\n";
}
?>
Shorter