eval help

From: Date: Mon, 03 Mar 2003 13:47:36 +0000
Subject: eval help
Groups: php.general 
Request: Send a blank email to php-general+get-137885@lists.php.net to get a copy of this message
Hi guys, My current task involves passing a string into a function that is able to reference variables defined within that function for the final output. The idea is that a function iterates through objects and eval's the string so that the objects data (name etc) is substituted in the string. Currently I have something like this: $someVar = "<br>testing for node - wootah, \$evalTestArr[TAG_PAGENAME]" .... then in some other function that gets passed this string ... $evalTestArr[TAG_PAGENAME] = "hello anna marie gooberfish!"; $str = $someVar; eval("\$str=\"$str\";"); if I echo it out, the substitution is not done. any thoughts? I'm reading through http://www.php.net/manual/en/function.eval.php but yet to be inspired.

« previous php.general (#137885) next »