Re: adding key-> value pair to an array

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

 



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

--
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