print() function in php
Last Updated by Pooja Chikara
0 2295
PHP print() function is used to output one or more strings. It is an inbuilt function of PHP. The working of the print() is the same as the working of echo() function but it is slower than echo() function.
The return type of this function is a string.
Syntax:
print($string);
In case of more than one string, use this function without parenthesis.
print $string1.$string2;
here,
$string, $string1 and $string2 are PHP strings
Example 1:
<?php $string="Welcome to Coding Tag"; print($string); ?>
Output:
Example 2:
<?php $string1="Welcome to "; $string2="Coding Tag"; print $string1.$string2; ?>
Output:

Share:
Recommended Topics:
You May Also Like
PHP Examples
News letter
Subscribe To Never Miss an Article From
Comments
Waiting for your comments