it is not passing url value from php to xml conversion
Warning: SimpleXMLElement::__construct(): Entity: line 141: parser error : EntityRef: expecting ';' in /home/u395985035/public_html/ddd/ddd.php on line 34
Warning: SimpleXMLElement::__construct(): http://teko.gogo.com/gtw_c?tem_id=844&erw_id=44545 in /home/u395985035/public_html/ddd/ddd.php on line 34
Warning: SimpleXMLElement::__construct(): ^ in /home/u395985035/public_html/ddd/ddd.php on line 34
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /home/u395985035/public_html/ddd/ddd.php:34 Stack trace: #0 /home/u395985035/public_html/ddd/ddd.php(34): SimpleXMLElement->__construct('\n\t\t
<?php
include("config.php");
$sql = "SELECT * FROM table1";
$q = mysqli_query($conn,$sql) or die(mysql_error());
$xml = "<demo1>\n\t\t";
while($r = mysqli_fetch_array($q)) {
$xml .= "<t_view>\n\t";
$xml .= "<l1>".$r['id']."</l1>\n\t\t";
$xml .= "<l2>".$r['link1']."</l2>\n\t\t";
$xml .= "</t_view>\n\t";
}
$xml .= "</demo1>\n\t\t";
$sxe = new SimpleXMLElement($xml);
$sxe->asXML("ddd.xml");
/* I am parsing url link with parameters in $r['link1'] */
?>