PHP 7 simpleXML

I had the same problem and I’m using Ubuntu 15.10. In my case, to solve this issue, I installed the package php7.0-xml using the Synaptic package manager, which include SimpleXml. So, after restart my Apache server, my problem was solved. This package came in the Debian version and you can find it here: https://packages.debian.org/sid/php7.0-xml.

SimpleXml to string

You can use the SimpleXMLElement::asXML() method to accomplish this: $string = “<element><child>Hello World</child></element>”; $xml = new SimpleXMLElement($string); // The entire XML tree as a string: // “<element><child>Hello World</child></element>” $xml->asXML(); // Just the child node as a string: // “<child>Hello World</child>” $xml->child->asXML();

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)