> i have come across a strange problem with variable variables. Basicly i'm
> doing the following and its not working:
>
> $section = 'data["SITE"][0]["NAME"][0]';
> $pData = 'My Site.';
> ${sprintf('$%s', $section)}.=$pData;
>
> but it is not working. But if i do this:
>
> eval('$'.$section.'.="'.addslashes($pData).'";');
>
> it works and all is well. I don't really want to use eval() and just
> wanted to see if anybody has any ideas why the above doesn't work.

Why is the sprintf in there?...

Try this:

${$section} .= $pData;

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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