【发布时间】:2012-11-28 16:44:35
【问题描述】:
我正在尝试处理可能输入的字符串
'something <p>hi</p> <br />'
输入字符串可以包含任何 HTML 标记,也可以不包含任何 HTML 标记。我想处理这个字符串而不格式化它。
基本上我现在正在拆分它,用 & 分隔符,我需要生成的输出数组仍然包含输入
等等……$ajaxinput = "function=submit&content=this is some page stuff <p>hi</p>";
echo 'Input : ' . $ajaxinput . '<br /><br /><br />';
$output = explode("&", $ajaxinput);
echo 'Split : ' . $output[0] . '<br /><br />';
echo 'Split : ' . $output[1];
输出是:
Input : function=submit&content=this is some page stuff
hi
Split : function=submit
Split : content=this is some page stuff
hi
我想要:
Input : function=submit&content=this is some page stuff <p>hi</p>
Split : function=submit
Split : content=this is some page stuff <p>hi</p>
【问题讨论】:
-
你想达到什么目的?问题是什么?
-
我已经在 :) 中编辑过了