Re: Re: eval help

From: Date: Mon, 03 Mar 2003 14:13:42 +0000
Subject: Re: Re: eval help
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-137888@lists.php.net to get a copy of this message
Hi, > $arr2["name"] = "Broness!"; .. > $str3 = "<br>Hello, $arr2['name']"; .. > eval ("\$evaldString = \"$str3\";"); > echo $evaldString; Your almost there... just remember one very simple rule - if in doubt, break out. Meaning, if you're having variable resolution issues, then just break out of the string. Apply the following change to have happy dreams: From: > $str3 = "<br>Hello, $arr2['name']"; To: > $str3 = "<br>Hello, ".$arr2['name']; -- Dan Hardiker [dhardiker@staff.firstcreative.net] ADAM Software & Systems Engineer First Creative

« previous php.general (#137888) next »