If you googling than also meet the answer but also check below code
‘);
$node->addChild(‘content’, $text);
$xml = $node->asXML();
file_put_contents(‘sample.xml’, $xml);
}
$xml = simplexml_load_file(‘sample.xml’);
$text = htmlspecialchars($xml->content);
?>
<html>
<head>
<title>HTML data: Storing in XML, editing with CKEditor</title>
<script type="text/javascript" src="https://stackoverflow.com/questions/27653081/ckeditor/ckeditor.js"></script>
</head>
<body>
<!-- Our page editing form -->
<form action="" method="post">
<textarea name="editor1">
<?php
// Echo our escaped HTML data into the textarea.
echo $text;
?>
</textarea>
<input type="submit" value="Submit">
</form>
<script>
// Add CKEditor to textarea with name 'editor1'.
CKEDITOR.replace( "editor1" );
</script>
</body>
</html>
- This above code is one Example but you can use as your way
- If any problem with this answer please comment me…:)
solved How to create xml files using php [closed]