In PHP, print is used to output one or more strings. Even though print behaves like a string function, it is technically not a function, as it doesn't require a parenthesis in its function.
print and echo are very similar in PHP. The one difference is that echo can be used to concatenate string, while print cannot do so.
The syntax of the print construct is:
Let's take a look at the examples below:
print 'You are reading a tutorial on PHP print construct.';
You are reading a tutorial on PHP print construct.
$var = 'Learn PHP print';
Learn PHP print