note 69292 added to function.var-export

From: Date: Wed, 30 Aug 2006 10:48:08 +0000
Subject: note 69292 added to function.var-export
Groups: php.notes 
Request: Send a blank email to php-notes+get-116504@lists.php.net to get a copy of this message
Here is a bit code, what will read an saved object and turn it into an array. Please note: It is very lousy style. Only an an idea. $data = file_get_contents("test.txt"); $data = preg_replace('/class .*{/im', 'array (', $data); $data = preg_replace('/\}/im', ')', $data); $data = preg_replace('/var /im', '', $data); $data = preg_replace('/;/im', ',', $data); $data = preg_replace('/=/im', '=>', $data); $data = preg_replace('/=>>/im', '=>', $data); $data = preg_replace('/\$(.*?) /im', '"$1"', $data); eval('$O = ' . $data . ';'); print_r($O); ---- Server IP: 212.124.37.9 Probable Submitter: 84.142.31.235 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.var-export.php Edit -- https://master.php.net/note/edit/69292 Del: integrated -- https://master.php.net/note/delete/69292/integrated Del: useless -- https://master.php.net/note/delete/69292/useless Del: bad code -- https://master.php.net/note/delete/69292/bad+code Del: spam -- https://master.php.net/note/delete/69292/spam Del: non-english -- https://master.php.net/note/delete/69292/non-english Del: in docs -- https://master.php.net/note/delete/69292/in+docs Del: other reasons-- https://master.php.net/note/delete/69292 Reject -- https://master.php.net/note/reject/69292 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#116504) next »