Posted by Toby A Inkster on 04/23/07 11:09
Boris Savc wrote:
> $a = "Hello";
> $b = 1;
>
> I want to change the name of $a to $a1 where 1 is value of variable $b!
${'a'.$b} = $a;
echo $a1;
That said, any time you're doing something like "${'a'.$b}", alarm bells
should be going off. You'd probably be better off using an array.
--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
Navigation:
[Reply to this message]
|