我正在使用这个插件,https://github.com/punkave/phpQuery来编辑HTML内容。
这是我的密码
//$formdata contains plain HTML
$doc = phpQuery::newDocument($formData);
//Some Editing
$editedData = phpQuery::getDocument($doc->getDocumentID());
//This returns object这将返回一个对象。有什么方法可以获得普通的HTML吗?
发布于 2016-11-30 11:28:53
可以将phpQueryObject对象强制转换为字符串:
$markup = (string) $editedData;发布于 2016-11-30 17:27:45
您也可以使用(0.9.5版)
$html = pq($editedData)->html();发布于 2016-11-30 11:16:01
http://php.net/manual/en/function.htmlentities.php我想这就是你要找的
https://stackoverflow.com/questions/40886836
复制相似问题