I am used to using "echo" to print text.
echo "hello";
Should I switch to using print now?
print ("hello");
echo or print
Moderator: General Moderators
Also, echo can also use what is called the ' here document ' syntax. It will let you print multiple lines to a browser with variable interpolation. An example would be:
echo <<<DOSOMETHING
<h1>Blah Blah, Blah Blah Blah, Blah!</h1>
<br><br>
DO DAH DAY!
DOSOMETHING; /* DOSOMETHING; MUST be at the very beginning of the line, no spaces or tabs before it. */
Real useful if you need to print chunks of html throughout your PHP code.
echo <<<DOSOMETHING
<h1>Blah Blah, Blah Blah Blah, Blah!</h1>
<br><br>
DO DAH DAY!
DOSOMETHING; /* DOSOMETHING; MUST be at the very beginning of the line, no spaces or tabs before it. */
Real useful if you need to print chunks of html throughout your PHP code.