Echo versus Question Mark Equals

Echo versus Question Mark Equals

am 06.08.2007 22:05:32 von kvnsmnsn

I'm taking a look at a piece of PHP code that begins:



<br /> <?php<br /> $doc_title = 'Business Registration';<br /> echo "$doc_title\n";<br /> ?><br />





...

What's the difference here between the statement
and the statement? Are they synonyms for each
other, or are there differences that I don't see?

---Kevin Simonson

"You'll never get to heaven, or even to LA,
if you don't believe there's a way."
from _Why Not_

Re: Echo versus Question Mark Equals

am 06.08.2007 22:10:29 von ivansanchez-alg

kvnsmnsn@hotmail.com wrote:

> What's the difference here between the statement
> and the statement? Are they synonyms for each
> other, or are there differences that I don't see?

See here:
http://www.php.net/manual/en/language.basic-syntax.php

And read carefully Example 10.2

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

The solution of this problem is trivial and is left as an exercise for the
reader.
-- Standard textbook cookie

Re: Echo versus Question Mark Equals

am 06.08.2007 22:15:45 von luiheidsgoeroe

On Mon, 06 Aug 2007 22:10:29 +0200, Iván Sánchez Ortega
wrote:

> kvnsmnsn@hotmail.com wrote:
>
>> What's the difference here between the statement
>> and the statement? Are they synonyms for each
>> other, or are there differences that I don't see?
>
> See here:
> http://www.php.net/manual/en/language.basic-syntax.php
>
> And read carefully Example 10.2
>

And take special care reading the last note:
"Note: Using short tags should be avoided when developing applications or
libraries that are meant for redistribution, or deployment on PHP servers
which are not under your control, because short tags may not be supported
on the target server. For portable, redistributable code, be sure not to
use short tags."
--
Rik Wasmus