Home >>PHP Programs >How to Print January to December using PHP
<?php $month_names = array("January","February","March","April","May","June","July","August","September","October","November","December"); echo "<select>"; foreach($month_names as $month) { echo "<option>".$month."</option>"; } echo "</select>"; ?>
<?php <select> <?php $month_names = array("January","February","March","April","May","June","July","August","September","October","November","December"); foreach($month_names as $month) { ?> <option value="<?php echo $month; ?>"><?php echo $month; ?></option> <?php } ?> </select> ?>
<?php function showMonthNames($month_names) { foreach($month_names as $month) { echo $month."<br/>"; } } showMonthNames($month_names); ?>