Learn PHP Print

Print  is  output key. It sends no matter what is in the quotations (or parentheses) that adhere to it to the result device (browser window). A new similar function is indicate, but print allows the particular user to check whether or not the print succeeded.

PHP print statement works extremely well to be able to print single line string, multi line strings, escaping characters, array etc.

Syntax of PHP print:

1
2
3
 <?php
int print(string $arg)    
?>  

Typically the quoted text is handled as if it were a string, and so works extremely well in conjunction with the concatenation (joining 2 strings together) operator since well as any perform that returns a thread value.

Example Printing Single string:

1
2
3
4
<?php    
print "Hello, World!";
print "Hello" . ", " . "World!";
?>  
 
Output:

Hello, World! 
Hello,World!

Example Printing Variable:

1
2
3
4
<?php    
$msg="Akshay is here";  
print "Message is: $msg";    
?>  
 
Output:
Message is:Akshay is here


Last Updated: 2018-07-06 12:32:44 By akshay

SHARE THIS

share_facebook share_twitter share_google_plus

Please Comment Here :