[英]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.