note 75045 added to function.range
| From: | chris at laflash dot org | Date: | Wed, 09 May 2007 23:47:42 +0000 |
| Subject: | note 75045 added to function.range | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-126371@lists.php.net to get a copy of this message | ||
Quick HTML menus with minimum and maximum sets of years:
<?php
/*
** Quick HTML menus with minimum and maximum sets of years.
** @author Chris Charlton <chris@laflash.org>
** @license FREE!
*/
// Years range setup
$year_built_min = 1900;
$year_built_max = date("Y");
?>
<select id="yearBuiltMin" size="1">
<?php // Generate minimum years
foreach (range($year_built_min, $year_built_max) as $year) { ?>
<option value="<?php echo($year); ?>"><?php echo($year);
?></option>
<?php } ?>
</select>
<select id="yearBuiltMax" size="1">
<?php // Generate max years
foreach (range($year_built_max, $year_built_min) as $year) { ?>
<option value="<?php echo($year); ?>"><?php echo($year);
?></option>
<?php } ?>
</select>
----
Server IP: 69.147.83.197
Probable Submitter: 64.183.55.30
----
Manual Page -- http://www.php.net/manual/en/function.range.php
Edit -- https://master.php.net/note/edit/75045
Del: integrated -- https://master.php.net/note/delete/75045/integrated
Del: useless -- https://master.php.net/note/delete/75045/useless
Del: bad code -- https://master.php.net/note/delete/75045/bad+code
Del: spam -- https://master.php.net/note/delete/75045/spam
Del: non-english -- https://master.php.net/note/delete/75045/non-english
Del: in docs -- https://master.php.net/note/delete/75045/in+docs
Del: other reasons-- https://master.php.net/note/delete/75045
Reject -- https://master.php.net/note/reject/75045
Search -- https://master.php.net/manage/user-notes.php