English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

PHP Basic Tutorial

PHP Advanced Tutorial

PHP & MySQL

PHP Reference Manual

PHP print() Function Usage and Example

PHP String Character String Functions Manual

The print() function is used to output strings.

Syntax

int print ( string $arg )

Definition and Usage

Return the output string.

print is actually not a function (but a language structure), so the parameter list does not need to be enclosed in parentheses.
And the main difference with echo: print supports only one parameter and always returns 1.

Return Value

It always returns1.

Parameter

Serial NumberParameters and Description
1

arg

Input Data

Online Example

Try the following example, print output text:

<?php
    //print output text:
   print "Hello world!"; 
?>
Test and see‹/›

Output Result

Hello world!

PHP String Character String Functions Manual