var_export
Output or return a string representation of a variable
var_export()
function outputs or returns structured information about the variable.
The function works similarly to var_dump()
, except that the return value of the function is valid PHP code.
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
var_export ( variable , return ) ;
parameter | describe |
---|---|
variable | Required. Specifies the variable to check. |
Return | Optional. If set to true, it returns the representation of the variable, rather than outputting it. |