Success is not final, failure is not fatal: it is the courage to continue that counts. – Winston Churchill

Print and Echo

Print and Echo

Because PHP was originally designed for the web, the ability to output content into the browser easily has always been possible. There are 2 functions for this, print and echo. Which one you choose to use is largely a matter of personal preference because the differences are subtle and not usually important.

echo “test123”;

print “test123”;

Both the examples below will produce the identical output of only “test123”, of course without the quotes. Using single quotes versus double quotes when outputting does create a difference with certain content including variables.

Leave a Reply

Your email address will not be published. Required fields are marked *

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

admin

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

admin