The Var_export () function returns the structure information about the variable passed to the function, similar to Var_dump (), unlike the PHP code whose returned representation is legitimate. Var_export must return a valid PHP code, that is, the code returned by Var_export can be directly assigned to a variable as PHP code. And this variable gets the same value as the Var_export type.
This example describes the use of the PHP format output file Var_export function. Share to everyone for your reference. Specific as follows:
Var_export (Array (' A ', ' B ', array (' AA ', ' BB ', ' cc '))//This is no different from Var_dump [code] $var =var_export (Array (' A ', ' B ', Array (' aa ', ' BB ', ' cc '), true)//plus true, will not print out, but give a variable, so you can directly output; echo $var;//The output form is similar to Var_dump () printing.
Example 2, the code is as follows:
The code is as follows:
$data = Array (' name ' = ' abc ', ' job ' = ' programmer ', ' a ' =>array (' AA ', ' cc ', ' BB ')); $data = Var_export ($data, true); Echo $data;
The output form is as follows:
Array ( ' name ' = = ' abc ', ' job ' = ' programmer ', ' a ' = = = Array ( 0 = ' AA ', 1 = ' cc ',
2 = ' BB ', ),