Re: echo vs assignment
| From: | Richard Lynch | Date: | Wed, 06 Dec 2000 03:05:39 +0000 |
| Subject: | Re: echo vs assignment | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28824@lists.php.net to get a copy of this message | ||
That's a shortcut that got added after many requests by ASPers for <?= as a
shortcut for <?php echo.
I don't know if it ever got added to the Docs in enough places to be as
widely-used or widely-documented as it should be, but it's in there
somewhere, so it's spec...
Rasmus still hates it :-) but you get tired of umpteen requests for
"something like <%=" every week.
It's really not an assignment operator in that context -- Just that =
happens to be part of the token <?=, which is its own token meaning "<?php
echo"
----- Original Message -----
From: Anthony Martin <Anthony@TRAMS.com>
Newsgroups: php.general
Sent: Monday, December 04, 2000 3:52 PM
Subject: [PHP] echo vs assignment
> I have gotten into the habit of using the assignment operator instead of
> echo in my HTML blocks. I don't remember where I picked it up, but I
think
> it's an SSI standard.
>
> Has anyone run into a problem with it? Example:
>
> <HTML>
>
> <?="Hello World"?>
>
> instead of
>
> <?echo "Hello World";?>
>
> ---
>
> <?=strToUpper('hello world')?>
>
> instead of
>
> <?echo strToUpper('hello world');?>
>
> ---
>
> <?=foo == true ? 'Foo!' : 'Bar!'?>
>
> instead of
>
> <?echo foo == true ? 'Foo!' : 'Bar!';?>
>
> </HTML>
>
>
>
> Anthony
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>