[英]phpQuery - how to get plain HTML
我正在使用此插件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?
您可以将phpQueryObject
对象转换为字符串:
$markup = (string) $editedData;
您也可以使用(0.9.5版)
$html = pq($editedData)->html();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.