Re: numerically named member variables and objects

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

 




On 11 Mar 2009, at 11:42, Dan Field wrote:

As far as I was aware, member variable and object names had to start with a non integer chracter, however I am utilising a JSON lib which is providing me with the following resultset. As you can see a member class member is numerically named and I am unable to address it in the usual way. Is there a way around this?

echo $this->results->highlighting->000012192->t_text[0];


And to answer my own question, the answer is to use the following notation:

echo $this->results->highlighting->{'000012192'}->t_text[0];

--
Dan Field <dof@xxxxxxxxxxx>                   Ffôn/Tel. +44 1970 632 582
Peiriannydd Meddalwedd                          Senior Software Engineer
Llyfrgell Genedlaethol Cymru                   National Library of Wales





[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