On Mon, Apr 2, 2012 at 4:34 AM, Maciek Sokolewicz
<maciek.sokolew...@gmail.com> 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

Reply via email to