PHP Print Statement

In php the print statement is used to display output on the browser. And like the echo statement print is also a language construct, so we can also use it without parenthesis like print or print(). Example of print statement :
<?php
  print "Hello world.";
  print "<br/><b>This is Test String.</b>";
  print "<br/><i>This is Another Test String.</i>";
?>
Output :

Hello world.
This is Test String.
This is Another Test String.

The print statement will display strings and also the strings with HTML markup. Unlike echo statement the print statement always returns 1. Now lets see some examples of print statement :

Printing variables with print :
<?php
  $num = 1000;
  $float = 25.80;
  $str = "Hello world";

  print "The \$num value is : $num<br/>";
  print "The \$float value is : $float<br/>";
  print "The \$str value is : $str<br/>";
?>
Output :

The $num value is : 1000
The $float value is : 25.8
The $str value is : Hello world

Print with escape character :
<?php
  print "This is the \"Important\" character of the string.";
?>
Output :

This is the "Important" character of the string.

Print statement with multi-line :
<?php
  print "This is the \"Important\" \
    character of the string
    which prints by using 
    The multiple lines.";
?>
Output :

This is the "Important" \ character of the string which prints by using The multiple lines.

Next Topic :