Page 1 of 1

veracity including bracket after echo ?

Posted: Thu Nov 05, 2009 7:03 am
by titphil
Hello,

I'm a "young" French developper in PHP. I learn on my own and, as I can see in differents forums or code source pages, some have brackets after "echo" and other not.

Are brackets needed for a site to be compliant such as W3C or, is it just an implementation in php 5.

This is just for my Personal culture.

Pleas forgive my English wich is not completed and thanks for answers.

Philippe.
May be I am not in the good post, for that, I beg your pardon.

Re: veracity including bracket after echo ?

Posted: Thu Nov 05, 2009 8:28 am
by AbraCadaver
titphil wrote:Hello,

I'm a "joung" French developper in PHP. I learn on my own and, as I can see in differents forums or code source pages, some have brackets after "echo" and other not.

Are brackets needed for a site to be compliant such as W3C or, is it just an implementation in php 5.

This is just for my Personal culture.

Pleas forgive my English wich is not completed and thanks for answers.

Philippe.
May be I am not in the good post, for that, I beg your pardon.
I presume that you are talking about the difference between this:

Code: Select all

echo "Hello";
and

Code: Select all

echo("Hello");
If so, it is just personal preference. It has nothing to do with HTML/XHTML compliance, nor does any PHP code. Only the HTML that you ouput matters.

-Shawn