Keyur Keyur - 8 months ago 67
PHP Question

phpQuery - how to get plain HTML

I'm using this plugin, for editing the HTML content.

This is my code,

//$formdata contains plain HTML
$doc = phpQuery::newDocument($formData);
//Some Editing
$editedData = phpQuery::getDocument($doc->getDocumentID());
//This returns object

This returns an object. Is there any way to get plain HTML?

Answer Source

You can cast the phpQueryObject object to a string:

$markup = (string) $editedData;