Hi all, a pretty straight forward example follows. Is this possible?? any help appreciated.
Thanks in advance babil
$a_0=1; $b=0; $c="\$a_".$b; echo $c; // output must be 1, not "$a_0"
Read the PHP Manual on variable variables.
$a_0 = 1; $b = 0; $c = ${'a_' . $b}; echo $c; // output should be 1
Still, have you considered using an array instead?
cool thanks it worked. I was not really sure if this was possible at all. I don't really need it in PHP. I need it in Actionscript, but I thought that if this is possible in PHP it should be possible in Actionscript too. I am writing a script in PHP that reads the values from a DB and parses it into Actionscript. I save the data in Arrays and then echo them as '&data_'.$i which is the format that Flash and AS understand. This saves me a lot of time in AS and I don't have to use arrays there. Just for the info, I just figured it out how this works with Actionscript.
many thanks babil