learn

What is echo

category: Ask
Created by: Dr.Ferrous

What is echo

category: Ask
Created by: Dr.Ferrous
twitter google+ facebook pinned 

Question

echo.php is mean?

by Joel

Answer

The echo statement in PHP is used to display the output of a given expression.

You can use the echo statement to display any type of data in PHP. For example numbers, strings, variables or any other expression.

Example:

You can see, echo keyword is followed by the string in double quotes. Similarly, you can use a variable name with a $ sign to display the variable value.

Example:

 

You can also echo multiple strings concatenated together. Example:

 

And here's an example of how to create html tags with echo:

 

Sometimes, you need to display quotes such as: phpwin's lessons

In that case, you have to escape the quotes by adding backslash just before each quote. Example:

 

 

But if you used double quotes, you don't have to escape the single quotes and vice versa. Example: