Re: Variable representation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 2, 2012 at 4:34 AM, Maciek Sokolewicz
<maciek.sokolewicz@xxxxxxxxx> wrote:
> Usually if you think you need to use eval: think again. In this case, it
> again holds true.
>
> Instead of doing what you do, you can also reference the variable as:
> echo ${'image_'.$i};
> or
> echo $GLOBALS['image_'.$i];
>
> Both are preferable by far over using eval, with all its potential security
> concerns.

Oh, man, this is a great list. I didn't even *think* about doing it that way.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux