I'm sorry to jump in mid-stream here (I've been offline for a while), but
was
$constant_value=${constant_name};
suggested?

eval's spook me, so I would prefer this solution over the working
suggestion you received.

This works for me on 4.0.4:

$test_name="ta_dah";
define("constant_name","test_name");
$constant_value=${constant_name};
echo $constant_value;

-- 
March 27, 2001: Tuesday is a scissors.
  Opposed blades make a finer cut.
      --http://artwells.com/oracula/




On Tue, 27 Mar 2001, Geoff Caplan wrote:

> Hi folks
>
> I had 2 suggestions from the list:
>
> 1) indirection - $constant_value = $$constant_name ;
>
> I had already tried this, but couldn't get it to work. Unless I am
> missing something it just gives an "Undefined Variable" error.
>
> 2) eval("\$constant_value = $constant_name;") ;
>
> This does work. Thanks Paul!
>
> Geoff Caplan
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to