【发布时间】:2014-01-17 10:13:08
【问题描述】:
大家好, 我对 phpquery 很陌生,这是我在 stackoverflow 上的第一篇文章,原因是我找不到正确的 phpquery 链接语法。我知道有人知道我一直在寻找什么。
我只想删除 div 中的某个 div。
<div id = "content">
<p>The text that i want to display</p>
<div class="node-links">Stuff i want to remove</div>
</content>
这几行代码完美运行
pq('div.node-links')->remove();
$text = pq('div#content');
print $text; //output: The text that i want to display
但是当我尝试时
$text = pq('div#content')->removeClass('div.node-links'); //or
$text = pq('div#content')->remove('div.node-links');
//output: The text that i want to display (+) Stuff i want to remove
谁能告诉我为什么第二个代码块不起作用?
谢谢!
【问题讨论】: