Aug 032010
Output the parsable string representation of a variable in PHP
Answer:
var_export allows you to outputs or returns a parsable string representation of a variable.
Example:
<?php
$a = array (
"foo" => 1,
"bar" => 2
);
echo var_export($a);
It gives:
array (
'foo' => 1,
'bar' => 2,
)
So you can use the output to declare the variable again in another PHP file.