FANDOM


Prints readable information about a variable.

ArgumentsEdit

void print r ({{{params}}})

Argument InclusionEdit

  • The return parameter was included in PHP 4.3.0

ExamplesEdit

Example 1: Printing a Human Readable list of a variableEdit

It is useful if you are printing to HTML, to encapsulate the output in pre tags (or a monospace font style) so that spacing is kept.

 <?php
 $array = array(array('left', 'right'), array('up', 'down'));
 print_r($array);
 ?>
 

OutputEdit

 Array
 (
    [0] => Array
        (
            [0] => left
            [1] => right
        )
    [1] => Array
        (
            [0] => up
            [1] => down
        )