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 -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -