Can anyone please help me fetch an email address from an XML file & insert it to a php code? Please find the codes below.
XML CODE
<?xml version="1.0" encoding="UTF-8"?>
<document>
<data>
<emailaddress>info@website.com</emailaddress>
</data>
</document>
PHP CODE
if($_POST){
$to_email = "<?php $xml=simplexml_load_file("data.xml"); echo $xml->data->emailaddress;?>";
}
This php code does not pull the email address from the xml file. Can anyone suggest me a fix?
Thanks heaps in advance!
Cheers David