05- PHP echo

0
687

This tutorial is all about PHP echo.
The echo command in PHP is used to output the text in the web browser. And echo is not a function, but it is a language construct. Meaning you don’t need to use a parenthesis with it.

How to output a String?
In retrieving a string output in PHP, we use echo. We place a string variable or we can use quotes, like what we are going to do in this example.
The code below we output a “Hello everyone!”. And the text output is being sent to the user in a form of a web page and it is very important to use a proper HTML syntax.
In the second echo, we simply put the <h3> tag at the beginning and closed it at the end of the string. Because we are using PHP to make web pages.

PHP CODE

 

Display:
Hello everyone!
PHP programming is fun!

Echoing Variables

In echoing variables using PHP is very easy because there are no quotations are required even if the variable does not hold a string.

PHP CODE

Display:
I am Christian Ignacio am 21 Years old

 

Readers might read also:

 

 

Facebook Comments
Previous article04- PHP Comments
Next article06- PHP Variables
Hello Itsourcecoders, welcome to itsourcecode.com. I'm Joken Villanueva, MIT a passionate Blogger, Programmer and a Hobbyist. I started Itsourcecode because I wanted to give back and Share all the learnings and knowledge I've learned in my career and I believe through this website I would be able to help and assist those newbie programmers in enhancing their skills from different programming languages. So let us all help each other by sharing our ideas!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.