PHP var_export() Function

By | January 7, 2020

Outputs or returns a parsable string representation of a variable. It will gives you structured information about the given variable.

Syntax :

 var_export ( mixed $expression [bool $return = FALSE ]);

$expression – The variable you want to export.
$return – This is optional. If it is used and set to true then it will return the variable representation instead of outputting it else it will return NULL.

Example :

$x = array("red", "green", "blue");
echo var_export($x);

Output:

array ( 0 => 'red', 1 => 'green', 2 => 'blue', )

4 thoughts on “PHP var_export() Function

  1. altyazili

    Having read this I believed it was extremely informative. I appreciate you spending some time and energy to put this content together. I once again find myself personally spending a lot of time both reading and leaving comments. But so what, it was still worth it! Jemima Osgood Lethia

Leave a Reply