最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php dom增加xml节点函数
时间:2022-06-24 20:53:03 编辑:袖梨 来源:一聚教程网
代码如下 | 复制代码 |
function: addcomment adds a comment. parameters: $data - associative array of data, must contain 'name', 'website', 'comment', 'date', 'user_ip', 'user_agent', and 'spam'. returns: id of the new comment. ]> */ public function addcomment($data) { $xml = new simplexmlelement($this->getcontents(true)); $message = $xml->addchild('message'); $id = $this->generateid(); $message->addattribute('mid', $id); foreach ($data as $key => $value) { $message->addchild($key, htmlspecialchars($value, ent_quotes)); } $this->putcontents($xml->asxml()); return $id; } |
相关文章
- ps怎样把一只可爱的小猴子照片转成素描效果? 07-12
- 原神武器幻化怎么获得 武器幻化获取方法 07-12
- 卡尔达诺价格预测:ADA突破阻力位,2025年第四季度有望冲击1.85美元 07-12
- 使用HTML5做的导航条详细步骤 07-12
- 剑星黑珍珠怎样获取 黑珍珠获取方式介绍 07-12
- 剑星黑玫瑰与天使玫瑰怎么获取 黑玫瑰与天使玫瑰获取方法一览 07-12