jacoblukewood jacoblukewood - 1 year ago 64
PHP Question

PHP echo correct input syntax

I can't seem to find a straight up answer on this…
Lets say I want to echo "Stack Overflow FTW" to the screen. Should I use

echo ('Stack Overflow FTW');


echo 'Stack Overflow FTW';

If it doesn't really matter, which one would be the best one to get into the habit of using?

Answer Source

echo isn't actually a function in PHP, it's a language construct. This means that parentheses are not required and as such I would recommend not using them as they just add clutter.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download