File, array to save the array to the file
$ Value) {$ str = $ GLOBALS [$ key]; $ GLOBALS [$ key] = 'changed '; if (& $ data = 'changed ') {$ strName = $ key; break;} $ GLOBALS [$ key] = $ str;} ob_clean (); ob_start (); echo"
$ Value) {++ $ I; if (is_array ($ value) {echo "\ n". (is_numeric ($ key )? $ Key: '\ ''. $ key.' \''). '=> array ('; echoArr ($ value, $ arrName. (is_numeric ($ key )? '['. $ Key. ']': '[\'. $ key. '\'] '); if ($ I! = $ ArrCount) echo '),'; else echo ')'; continue;} if ($ I! = $ ArrCount) echo (is_numeric ($ key ))? $ Key: '\ ''. $ key.' \''). '=>'. (is_numeric ($ value )? $ Value: '\ ''. $ value.' \''). ','; else echo (is_numeric ($ key ))? $ Key: '\ ''. $ key.' \''). '=>'. (is_numeric ($ value )? $ Value :'\''. $ value. '\ '');} echo' $ '. $ strName. '= array ('; echoArr ($ data, ''); echo ');'; echo" \ n?> "; $ File = fopen ($ strName. '. arr. php ', 'w'); fwrite ($ file, ob_get_contents (); fclose ($ file); ob_clean (); return true ;}?>
'Test', 2 => array ('hello123'); cacheArr ($ hello); unset ($ hello); // read the array require 'Hello. arr. php '; print_r ($ hello);?>
The above is the content that stores the array in the file. For more information, see PHP Chinese network (www.php1.cn )!