Replace content of <div>

10 views
Skip to first unread message

Dmitry Prostoy

unread,
Oct 23, 2009, 2:44:30 AM10/23/09
to phpQuery
Hi,

I have html code in text field. I need to find and replace content of
<div> which has exact id. This div block can have any internal html
code, including internal divs. It does not matter.

I tried to use phpQuery for this purpose. So I search and replace
using pq("#myid").html("mycontent"); Seems it works. But my question
is how can I apply this replacement in my original html text?

Thanks for supporting in advance,
Dmitry

Tobiasz Cudnik

unread,
Oct 23, 2009, 3:45:43 AM10/23/09
to phpQuery
Hi,

Export text field ontent into new phpQuery document, make needed
replacements and then send it back to text field. Use functions such
as .val() and ::newDocument().
Reply all
Reply to author
Forward
0 new messages