print_r
Print variables in an easy to understand format
print_r()
function prints information about variables in a more readable way.
Print information about some variables in a more readable way:
<?php $a = array ( "red" , "green" , "blue" ) ; print_r ( $a ) ; echo "<br>" ; $b = array ( "Peter" => "35" , "Ben" => "37" , "Joe" => "43" ) ; print_r ( $b ) ; ?>
Try it yourself
print_r ( variable , return ) ;
parameter | describe |
---|---|
variable | Required. Specifies the variable to return information. |
Return |
Optional. When set to true, the function returns information (rather than printing it). Default is false. |