Re: Question on eval()

From: Date: Wed, 27 Mar 2002 17:01:27 +0000
Subject: Re: Question on eval()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-90378@lists.php.net to get a copy of this message
Maybe parse_str() will do the trick? I am using it in a close situation, I store: a=1&b=1 And $a has value 1, $b has value 2. But I guess to work in your case you would need to stripslashes(); and str_replace(';', '&', $string) before the parse_str(); -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 <heinisch@creaction.de> wrote in message news:4.3.1.2.20020327173338.00bb6220@pop.compuserve.com... Hi Folks, I save an ascii-sentence, representing my vars and their values in the db after I request them, I try to eval them. here is what I get back from the db $scar=\"3\";$anrede=\"Herr\";$pf_name=\"wert\";$pf_kontem=\"tzrtzetrz\";$pf_ kontel=\"zuoioopöl\";$zeit=\"\";$pf_wt=\"löjlköjklö\";$sto=\"2\"; (values are just typed in ;-) ) then I try to eval them with $tmpeval=$vars[1]; // $vars[1] is where the data is in my answer-array eval ("\$tmpeval = \"$tmpeval\";"); after this ther should each var have it´s values like $scar should be 3 $anrede should be Herr I also tried $tmpeval=stripslashes($tmpeval); but that doesn´t work either. Can anybody see my mistake, or is there any length-limit in eval ?? TIA Oliver

« previous php.general (#90378) next »