<?php $name = 'carey'; echo $name; ?> LMAO.. I just learned how to do that... What is the difference between echo $name and print $name do they both work?
www.php.net/print www.php.net/echo See Links Or use the Search feature, or... scroll down the PHP Forum Page. http://forums.digitalpoint.com/showthread.php?t=321434
fixed <?php $a = '1'; $b = '5'; if($a < $b) { echo yes; } if($a > $b) { echo No; } ?> Code (markup): fixed
Kalyse has correctly pointed out the PHP man pages for the commands "print" and "echo". They both accomplish the same thing, though there is a debate amoung users about which command is the better one to use for large projects. While PHP implements both commands, perl only implements print in the language.
and you should wrap strings that you echo in single or double quotes, one word will work like echo word; but echo two words; would need to be echo 'two words'; its best to wrap everything you echo in something I tend to use print, printf, sprintf when writing large applications, instead of using double quotes or echo ......
^^ Good point, I didn't see that. Without quotes they will be considered constant. But since they're not defined as such it will leave an E_NOTICE.