phpicoder Nov 2, 2021 php

In this tutorial you will learn how to use the PHP echo and print statements to display the output in a web browser.

PHP use then echo and print statement to display the output.
PHP have a two ways to get the output.

  1. echo
  2. print

Difference between `echo` and `print`


This statement can pass multiple string separated by ','.

It doesnot return any values.

It is faster compared print.


  echo "<h2>Welcome phpicoder</h2>";
  echo "I'm PHP Debelopoer!<br>";
  echo "Hello ", "This ", "string ", "was ", "made ", "with multiple parameters.";
Welcome phpicoder
I'm PHP Debelopoer!
Hello This string was made with multiple parameters.


It cannot pass multiple strings.

It always return 1.

It is slower compared echo.


  print "<h2>Welcome phpicoder</h2>";
  print "I'm PHP Debelopoer!<br>";
  print "We are learn in PHP!";
Welcome phpicoder
I'm PHP Debelopoer!
We are learn in PHP!

I hope this tutorial help for you.