I am having problem with creating xml with codeigniter any help please!
here is what im doing
$this->load->helper('xml');
$data['settings'] = $this->settings_model->getSettings();
$string = $this->load->view('sitemap', $data);
$string = '<p>Here is a paragraph & an entity ({).</p>';
$string = xml_convert($string);
echo $string;
My Answer:
load->library('xml_writer');
$data = array(
'name' => 'John Doe',
'age' => 30,
'email' => 'john.doe@example.com'
);
$xml = $this->xml_writer->get_xml_from_array($data);
echo $xml;
This code snippet assumes that you have already loaded the XML Writer library in CodeIgniter. The get_xml_from_array method is used to convert the array data into XML format. Make sure to check if the XML Writer library is properly loaded and configured in your CodeIgniter application.
Rate this post
5 of 5 based on 2577 votesComments