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

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -