Prints a variable in readable form.
print_r() prints a variable in a form that is easy to read. This is especially useful while debugging, to print out arrays. As of PHP 4.3.0, there is an optional parameter that makes print_r() return a string instead of directly outputting the result.
<pre>
<?php
$array1 = array(
"un" => "one",
"deux" => "two",
"trois" => "three");
print_r($array1);
?>
</pre> Array
(
[un] => one
[deux] => two
[trois] => three
) This example shows how print_r() formats the output of an array. If not used together with the <pre> html tag, the elements will show up all on one line, making the output significantly less readable.