PHP print() Function

PHP print() Function

The print() function in PHP is used to output one or more string.

Syntax

print ( string $arg )

Parameter

arg(required)- This parameter represents the input data. It can take one or more arguments.

Return

This function returns an integer value 1.

Example 1

 

Output

Hello PHP World!

Example 2

  

Output

PHP is an  easy programming language to learn! 

Example 3

"22");
print "I am " . $age['Reema'] . " years old.";
?> 

Output

I am 22 years old.

Example 4

   

Output

Hello PHP!
This is an print() function example.