❮ PHP Variable Handling Reference
Output structured information about variables:
<?php
$a = 32;
echo var_export($a) . "<br>";
$b = "Hello world!";
echo var_export($b) . "<br>";
$c = 32.5;
echo var_export($c) . "<br>";
$d = array("red", "green", "blue");
echo var_export($d) . "<br>";
$e = array(32, "Hello world!", 32.5, array("red", "green", "blue"));
echo var_export($e) . "<br>";
?>
Try it Yourself »
The var_export() function outputs or returns structured information about a variable.
This function works similar to var_dump(), except that the returned value for this function is valid PHP code.
var_export(
variable,
return);
Parameter | Description |
---|---|
variable | Required. Specifies the variable to check |
return | Optional. If set to true, it returns the variable representation instead of outputting it |
Return Value: | If return is set to TRUE, it returns the variable representation. Otherwise, it returns NULL |
---|---|
Return Type: | Mixed |
PHP Version: | 4.2+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!