Re: 2 Syntax Questions
| From: | Jason Wong | Date: | Sat, 04 May 2002 11:50:31 +0000 |
| Subject: | Re: 2 Syntax Questions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-96035@lists.php.net to get a copy of this message | ||
On Saturday 04 May 2002 19:37, Miva Guy wrote:
> I'm very new to PHP. I've scanned the manual for these two, but I can't
> quite find the answers:
Wouldn't it have been quicker to just try it for yourself?
> 1. Is the following legal?
> <INPUT TYPE="hidden" NAME="user_id" VALUE="<? echo $user_id
> ?>">
> Or is it necessary to do this?
> <? echo("<INPUT TYPE=\"hidden\" NAME=\"user_id\"
> VALUE=\"".$user_id."\">"); ?>
Both are OK. But for readability you could change the second to:
<? echo('<INPUT TYPE="hidden" NAME="user_id" VALUE="' .
$user_id .'">'); ?>
> 2. If I use the <? if: else: endif; ?> syntax to avoid echoing larger
> blocks of HTML, within those statements, is it legal to use the standard <?
> if(...) {...} else {...} ?> syntax?
Yes.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
You possess a mind not merely twisted, but actually sprained.
*/