note 6122 deleted from Variables by ronabop

From: Date: Sat, 12 Aug 2000 21:58:37 +0000
Subject: note 6122 deleted from Variables by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-1612@lists.php.net to get a copy of this message
I don't know if this goes here or under strings, but it seems to fit here, so here goes: I retrieve a string from a database that has a variable reference in it. How do I re-evaluate the contents of a variable for further variable references? Example: <pre> $toeval = '${x}) List item.' . "n"; for ($x = 1; $x < 3; $x++) echo reeval($toeval); </pre> I want that code to output: <pre>1) List Item. 2) List Item. 3) List Item.</pre> I know there are ways of doing this, but like I said, I'm retrieving the string from a database, so this is my only option short of parsing the database string. Pax.

« previous php.notes (#1612) next »