❮ PHP Variable Handling Reference
Print the information about some variables in a more human-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 »
The print_r() function prints the information about a variable in a more human-readable way.
print_r(
variable,
return);
Parameter | Description |
---|---|
variable | Required. Specifies the variable to return information about |
return | Optional. When set to true, this function will return the information (not print it). Default is false |
Return Value: | If variable is integer, float, or string, the value itself will be printed. If variable is array or object, this function returns keys and elements. If the return parameter is set to TRUE, this function returns a string |
---|---|
Return Type: | True or String |
PHP Version: | 4.0+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!