Return to Snippet

Revision: 1315
at September 27, 2006 11:36 by gdonald


Updated Code
function getDayOptions( $selected )
{
    $options = '';

    for( $x = 1; $x < 32; $x++ )
    {
        if( strlen( $x ) == 1 ) $x = '0' . $x;

        $options .= '<option value="' . $x . '"';

        if( $x == $selected )
        {
            $options .= ' selected="selected"';
        }

        $options .= '>' . $x . '</option>';
    }

    return $options;
}

Revision: 1314
at September 27, 2006 11:36 by gdonald


Initial Code
function getDayOptions( $selected )
{
    $options = '';

    for( $x = 1; $x < 32; $x++ )
    {
        if( strlen( $x ) == 1 ) $x = '0' . $x;

        $options .= '<option value="' . $x . '"';

        if( $x == $selected )
        {
            $options .= ' selected="selected"';
        }

        $options .= '>' . $x . '</option>';
    }

    return $options;
}

Initial URL

                                

Initial Description

                                

Initial Title
PHP month days options

Initial Tags

                                

Initial Language
PHP