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
Post a Comment