我在php中创建一个简单的Web应用程序。
当用户以xml格式保存数据时所有数据存储。
所以,请给我解决方案。
答案 0 :(得分:0)
&#39); $ 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="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>