Easy Tutorial
❮ Func Misc Die Php Ajax Poll ❯

PHP print() Function

PHP String Reference Manual

Example

Output some text:


Definition and Usage

The print() function outputs one or more strings.

Note: The print() function is not actually a function, so you do not have to use parentheses with it.

Tip: The print() function is slightly slower than echo().


Syntax

Parameter Description
strings Required. One or more strings to be sent to the output.

Technical Details

Return Value: Always returns 1.
PHP Version: 4+
--- ---

More Examples

Example 1

Output a string variable:

Example 2

Output a string variable:

Example 3

Concatenate two string variables:

Example 4

Output the values of an array:

Example 5

Output some text:

Example 6

The difference between single and double quotes. Single quotes will output the variable name, not the value:

❮ Func Misc Die Php Ajax Poll ❯