html() does not work

28 views
Skip to first unread message

cusaro

unread,
Sep 4, 2011, 5:28:19 PM9/4/11
to phpQuery
hello,

i can't figure out why my code ist not working:

foreach(pq('#content p')->contents() as $text) {
$content = pq($text)->html();
$content = str_replace('test','<b>test</b>',$content);
pq($text)->html($content); <- this line dosen't work
}

with foreach(pq('#content')->contents() as $text) { it works but i
need the p to select.

thank you.
Reply all
Reply to author
Forward
0 new messages