Re: var_export() strips slashes

From: Date: Wed, 12 Feb 2003 21:56:09 +0000
Subject: Re: var_export() strips slashes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-135373@lists.php.net to get a copy of this message
Is this a real bug, or am I just doing something stupid? :-) Thanks! Shawn > Seems that var_export() strips slashes from my array keys even though the > docs say that it returns valid PHP code. This is bad if I want to use $b > below to define another array, gives a parse error on the single quote in > the key. > > $a = array('it\'s here' => 'single, \' double "'); > $b = var_export($a, TRUE); > echo $b; > > Displays: > array ( 'it's here' => 'single, \' double "', ) > > And: > $c = eval($b); > > generates a parse error in the eval'ed code. > > Any help??? > > TIA, > -Shawn > > >

« previous php.general (#135373) next »