veracity including bracket after echo ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
titphil
Forum Newbie
Posts: 1
Joined: Thu Nov 05, 2009 6:45 am

veracity including bracket after echo ?

Post 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.
Last edited by titphil on Thu Nov 05, 2009 9:00 am, edited 1 time in total.
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: veracity including bracket after echo ?

Post 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
Post Reply