Page 1 of 1

Delete and write within body tags

Posted: Wed Apr 20, 2011 8:39 am
by zyntrax
Hi i am wondering if it is possible to open a html document and delete everything between the body tags and then write between them and if so how is that possible?

I know how to read between them with preg_match.

What im trying to do is to use tinymce to edit webpages, i have successfully managed to read everything between the body tags and load it in tinymce and now is the last part to save it.

Help would be very much appreciated.

Re: Delete and write within body tags

Posted: Wed Apr 20, 2011 9:32 am
by strafingmoose
http://simplehtmldom.sourceforge.net/

All hail the Simple HTML DOM Parser :)

Re: Delete and write within body tags

Posted: Tue Apr 26, 2011 3:44 am
by zyntrax
Nice i think this will work well

Thanks.

Re: Delete and write within body tags

Posted: Tue Apr 26, 2011 4:03 am
by getmizanur
strafingmoose wrote:http://simplehtmldom.sourceforge.net/

All hail the Simple HTML DOM Parser :)
Thanks for that, I don't need it now however I can see how I may need it in the future.

Re: Delete and write within body tags

Posted: Tue Apr 26, 2011 7:29 am
by zyntrax
I also found preg_replace, but first i'm going to see if i can make html dom work :)