phpQuery ignores part of an imported file

馋奶兔 提交于 2019-12-25 01:25:48

问题


the following code:

<?
  require_once "phpQuery.php";
  $dom = phpQuery::newDocument( "<head></head><body>this is ignored</body>" );
  echo nl2br( htmlentities( $dom ) );
?>

should give this is ignore, but the entire body seems to be ignored.

I stripped down the code to where the problem was still there. I want to read links ($dom->find('a')) from the body, but found out nothing was found even though there were links in the body.

What am I doing wrong?


回答1:


Does phpquery require valid xml bodies? If so, you should wrap your document in a <html> tag.



来源:https://stackoverflow.com/questions/6522438/phpquery-ignores-part-of-an-imported-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!