getting XML data from MySQL using Eloquent



I have a database where I store XML data. I need to get the data in xml format using Eloquent. But what I get is plain text which cannot be used in simpleXml. Here is what I have done:



$Qusetion1 = QType1::find(1);//QType1 is Eloquent Model
$xml_Data = $Qusetion1->question;//question is the column name where I store XML formatted data


When I echo xml_Data, I get only the plain text without XML nodes.


My question is: How can I get XML data from a MySQL database and use it with SimpleXML? Thanks


No comments:

Post a Comment