So, what i am trying to achieve is to load variables from PHP into an XML file.
this is how my XML looks at the moment:
<?xml version="1.0" encoding="ISO-8859-1"?>
<firstname></firstname>
<lastname></lastname>
And this is my PHP where i try to save the variables into the XML
$file = simplexml_load_file("filename.xml");
$xml->firstname = "Mark";
$xml->lastname = "Zuckerberg";
file_put_contents($file, $xml->asXML());
If i try to print this i get following error message:
Call to undefined method stdClass::asXML() in ... on line 1374
Any suggestions?
$file = ...+$xml->asXML()