예제 #1
0
 function test_strToDoc()
 {
     $html = '<html><head><meta charset="UTF8"></head><body></body></html>';
     $doc = HtmlUtils::strToDoc($html);
     $this->assertTrue(is_object($doc));
     $this->assertTrue($doc->isHtml());
 }
예제 #2
0
 /**
  * Converts the given HTML document into a phpQueryObject document if not
  * already.
  * 
  * @param  string|phpQueryObject $obj the input HTML document. It could be a HTML string or already
  *                                    a phpQueryObject
  * @return phpQueryObject      the resulting HTML document 
  */
 public static function toDoc($obj)
 {
     return is_object($obj) ? $obj : HtmlUtils::strToDoc($obj);
 }