How to store php array to text -
i have php array this.
$config['sample'] = array( 'key1' => 'val1', 'key2' => 'val2' );
and want value in $config['sample'] write in text file this.
$newcfg['sample'] = array( 'key1' => 'val1', 'key2' => 'val2' );
how convert php array value text string before write text file?
ps. 1. cannot use serialize because when write file, must ready use in php same $config['sample'] value.
ps. 2. cannot use json encode/decode also. same reason cannot use serialize.
use var_export works. @fr4nk
you looking var_export
. exports variable executable php code. write text file.
Comments
Post a Comment