|
Posted by David Haynes on 11/04/05 13:43
Mark ??;-) wrote:
>> Email me a copy and I'll take a look. (davidDOThaynes2ATsympaticoDOTca)
>>
>> -david-
>>
>
> Thanks for all your help. I am working on understanding the class. I did
> make a little bit of a change and modeled this method on yours. I had to
> add the str_pad, because I just can't stand the leading zeros dropping off.
> I will work with your class some more tomorrow and try and make it work with
> my form.
>
> -Mark
>
> function printMinute() {
> echo "<select name=\"Minute\">\n";
> foreach ( range(0,55,5) as $option) {
> if ( $option == $this->minute) {
> echo "<option selected>" . str_pad($option, 2, 0,
> STR_PAD_LEFT) . "</option>\n";
> }else {
> echo "<option>" . str_pad($option, 2, 0, STR_PAD_LEFT) .
> "</option>\n";
> }
> }
> echo "</select>\n";
> }
>
>
You could use printf('%02d', $option) instead of str_pad if you wanted to.
-david-
Navigation:
[Reply to this message]
|