Re: Simple Question
| From: | Matt McClanahan | Date: | Mon, 03 Jul 2000 01:40:08 +0000 |
| Subject: | Re: Simple Question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4422@lists.php.net to get a copy of this message | ||
On Mon, 3 Jul 2000, Tom Peck wrote:
> Hello everybody.
>
> I am new to PHP - with an ASP background. Quick question, is there an
> equilivent to eg:
>
> <SELECT id=game name=game>
> <OPTION VALUE=sltValue><%= variabletoshow %></OPTION>";
> </SELECT>
Yes, in fact it's quite similar.
<SELECT id=game name=game>
<OPTION VALUE=sltValue><?= $variabletoshow ?></OPTION>
</SELECT>
This will only work in PHP4, however. Another way that would be
compatible with PHP3 would be
<SELECT id=game name=game>
<OPTION VALUE=sltValue><? echo $variabletoshow ?></OPTION>
</SELECT>
However this will only work if short_tags is enabled. If it's not
enabled, just use <?php as you originally thought instead of <?
Matt