PHP function print_r()

Availability in PHP 4.0

Prints human-readable information about a variable

Parameters

Parameter Data type Default value Note
$expression mixed not The expression to be printed.
$return bool null If you would like to capture the output of print_r, use the return parameter. If this parameter is set to true, print_r will return its output, instead of printing it (which it does by default).

Return values

mixed

If given a string, integer or float, the value itself will be printed. If given an array, values will be presented in a format that shows keys and elements. Similar notation is used for objects.

Other resources

Official documentation for the print-r function

Newsletter

Nejlepsi tipy a triky o PHP do Vaseho e-mailu. Clanky a novinky nejen ze sveta PHP a programovani.