|
Posted by Pedro Graca on 10/11/06 09:17
Garry Jones wrote:
> The following code is the start of a the only way I know to do this. There
> must be an easier way as there can not be a need for 3600 variables for one
> funtion?
There's 1440 minutes in a day. How did you come up with 3600?
> So I would like to know how this is "supposed" to be done before I write my
> 10 800 lines of code.
Maybe like this?
// ...
$db_value = 815; // something between 0 and 2359; but 888 is invalid!!!
for ($i=0; $i<2360; ++$i) {
if ($i%100 < 60) {
echo '<option value="', $i;
if ($i == $db_value) {
echo ' selected="selected"';
}
echo '">', substr('0' . number_format($i/100, 2), -5), "</option>\n";
}
}
// ...
--
File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot
Navigation:
[Reply to this message]
|