PHP Tutorial
Home
PHP Install Xampp
PHP Syntax & Comments
PHP Variables
PHP Constants
PHP Data Types
PHP Echo & Print
PHP Strings
PHP If...Else...Elseif
PHP Ternary Operator
PHP Loops
PHP Functions
PHP Arrays
PHP GET & POST
PHP Advanced
PHP Date and Time
PHP Include and Require
PHP File Upload
PHP Sessions
PHP Cookies
PHP Send Email
PHP JSON Parsing
PHP MySQL Database
PHP MySQL Introduction
PHP Connect to MySQL
PHP MySQL Create DB
PHP MySQL Create Table
PHP MySQL Insert Data
PHP MySQL Select Data
PHP MySQL Delete Data
PHP MySQL Update Data
PHP MySQL Where
PHP echo Statement
PHP echo statement can output one or more strings. PHP echo statement can be used to print the variable, string, multi-line strings, escaping characters etc.
echo does not need parenthesis although you can use the parenthesis if you want.
<?php echo "<h2>This is PHP Tutorial !</h2>"; echo "Hello world!<br>"; echo "I'm about to learn PHP!<br>"; echo ("I am enclosed in parenthesis"); ?>
PHP print Statement
echo and print are both statement works exactly the same way except that the print statement can only output one string, and always returns 1. That is why the echo statement considered marginally faster than the print statement since it does not return any value.
<s?php print "<h2>This is PHP Tutorial!</h2>"; print "Hello world!<br>"; print "I'm about to learn PHP!"; print ("I am enclosed in parenthesis"); ?>