输出如下在 output.txt 文件中恢复:
the output is like below restored in a output.txt file:
array (
'IMType' => '1',
'Email' => 'test@gmail.com',
'SignupName' => 'test11',
'Password' => '11111',
'Encrypted' => '',
'Confirm' => '11111',
'OldPassword' => '',
'Name' => 'test',
'SignupProvinceText' => 'province',
'SignupCity' => 'cityname',
'Street' => 'street x.y',
'SignupIndustry' => 'IT',
'SignupCompany' => 'jobirn',
'SignupJt' => 'engineer',
'CellPhoneNum' => '',
'linked_in' => '',
)
实际上是var_export(my_variable,true)
的输出,但是如何再次读入变量?
it's in fact output of var_export(my_variable,true)
,but how to read it into a variable again?
像这样:
$dumpStr = var_export($var,true);
eval('$somevar = ' . $dumpStr.';');
这篇关于如何将var_export的输出读入PHP中的变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!