note 43679 deleted from control-structures.alternative-syntax by tomsommer
| From: | tomsommer@php.net | Date: | Wed, 30 Jun 2004 05:15:29 +0000 |
| Subject: | note 43679 deleted from control-structures.alternative-syntax by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-72155@lists.php.net to get a copy of this message | ||
Note Submitter: leonardo@digitalnetwork.com.ar
----
You can use <?=$var ?> to 'echo' variables.
so you can write code like a select with -auto selected current item- like this...
<select name="select">
<?
while (list($key, $val) = each ($select_data)) {
?>
<option value="<?=$key ?>" <?=($key == $select) ? "selected":
""; ?>><?=$val ?></option>
<?
}
?>
</select>
Saludos!
Leonardo Papa.
Digital Network Argentina.