phpphpquery

phpQuery - how to get plain HTML


I'm using this plugin, https://github.com/punkave/phpQuery 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?


Solution

  • You can cast the phpQueryObject object to a string:

    $markup = (string) $editedData;