I'm exporting some data from a kml file to mysql, there's an xml chunk <multigeometry>
that I would like to save in the database as raw xml (because it's too complex to break down), my plan was to use json_encode and then convert the json back to xml when reading the mysql table but this task is proving to be very complicated,
Is it possible to just get the xml from the stdclass somehow? Or is there a better way of getting this saved in the database and converting back to XML?
$xml = simplexml_load_file("countries.kml")
foreach($xml->children() as $nodes){
foreach($nodes->children() as $n => $data){
mysql_query("insert into tbl_countries (varname,ISOA2,multigeometry) values ('".$data->name."','".substr($data->description,7,2)."','".json_encode($data->MultiGeometry)."')") or die(mysql_error());
}
}