note 36606 added to function.var-export

From: Date: Thu, 16 Oct 2003 04:43:11 +0000
Subject: note 36606 added to function.var-export
Groups: php.notes 
Request: Send a blank email to php-notes+get-58674@lists.php.net to get a copy of this message
If you're like me, you're wondering why a function that outputs "correct PHP syntax" is useful. This function can be useful in implementing a cache system. You can var_export() the array into a variable and write it into a file. Writing a string such as <?php $string = '<?php $array = ' . $data . '; ?>'; ?> where $data is the output of var_export() can create a file that can be easily include()d back into the script to recreate $array. The raw output of var_export() could also be eval()d to recreate the array. ---John Holmes... ---- Manual Page -- http://www.php.net/manual/en/function.var-export.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+36606 Delete -- http://master.php.net/manage/user-notes.php?action=delete+36606&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+36606&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#58674) next »