xml - Parse Error in php -



xml - Parse Error in php -

bellow statement showing parse error

echo $xmlarray[ota_hotelavailrs][properties][property][0_attr][hotelcitycode];

error: syntax error, unexpected t_string, expecting ']'

how solve this?

php assumes unquoted literals constants , constant names can't start numbers. results 0_attr beingness parsed number 0 followed constant _attr - not amke sense.

always quote array indices.

echo $xmlarray['ota_hotelavailrs']['properties']['property']['0_attr']['hotelcitycode'];

php xml arrays

Comments

Popular posts from this blog

c# - Move local mssql database to webhosted MYSQL -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

java - How to pass parameters between Request-Scoped Controllers? -