note 43679 added to control-structures.alternative-syntax

From: Date: Wed, 30 Jun 2004 03:59:37 +0000
Subject: note 43679 added to control-structures.alternative-syntax
Groups: php.notes 
Request: Send a blank email to php-notes+get-72148@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/control-structures.alternative-syntax.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43679 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43679&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43679&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#72148) next »