I'm getting the following error when trying to add some data from myXml.xml to a string: Parse error: syntax error, unexpected T_OBJECT_OPERATOR.
$xmlstr = file_get_contents('myXml.xml');
$xml = new SimpleXMLElement($xmlstr);
foreach($xml->order as $order){
$replace = array();
$firstName = (string) $order->billing-address->first-name;
$lastName = (string) $order->billing-address->last-name;
}
I can't provide my XML directly as it contains sensitive data.
Thanks, Sam