Re: adding key-> value pair to an array
| From: | Nathan Rixham | Date: | Wed, 03 Dec 2008 19:05:51 +0000 |
| Subject: | Re: adding key-> value pair to an array | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-284063@lists.php.net to get a copy of this message | ||
Jim Lucas wrote:
I don't think the above will work either, afaik php doesn't allow you to have variable names start with numbers.well debatable.. ################# $12 = 'value'; Parsing Error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' ################# $varname = 12; $$varname = 'sentence'; echo $$varname; //echos sentence ################# ${12} = 'some string here'; echo ${12}; //echos some string here ################ //you can get really stupid with this.. ${false} = 'some string here'; echo ${''}; //echos some string here