UEditor 在PHP中的应用
在index.html中引入ueditor,index.html编辑如下:
<?php
//取POST值
$content = $_POST['传值名称'];
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>editor测试</title>
<script src="/ueditor/ueditor.config.js">/*引入配置文件*/</script>
<script src="/ueditor/ueditor.all.js">/*引入源码文件*/</script>
</head>
<body>
<form action="" method="post">
<textarea id="content" rows="10" cols="70" name="传值名称" style="border:1px solid #E5E5E5;">
//内容
</textarea>
<script type="text/javascript">
UE.getEditor("content");//实例化编辑器 传参,id为将要被替换的容器。
</script>
</form>
</html>
宽高自己定义属性就行
PHP获取值的话和其它表单属性一样 添加一个name 用$_POST[ ’ name名称 ’ ] 获取
本文详细介绍了如何在PHP环境中使用UEditor富文本编辑器。通过示例代码展示了如何在HTML页面中引入UEditor,设置编辑器,并通过POST方法获取编辑器内容。适用于希望在网站上实现富文本输入功能的开发者。
609

被折叠的 条评论
为什么被折叠?



