Delete and write within body tags

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zyntrax
Forum Commoner
Posts: 32
Joined: Wed Apr 13, 2011 2:23 am
Location: Sweden

Delete and write within body tags

Post 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.
strafingmoose
Forum Newbie
Posts: 15
Joined: Mon Apr 18, 2011 2:56 pm

Re: Delete and write within body tags

Post by strafingmoose »

http://simplehtmldom.sourceforge.net/

All hail the Simple HTML DOM Parser :)
zyntrax
Forum Commoner
Posts: 32
Joined: Wed Apr 13, 2011 2:23 am
Location: Sweden

Re: Delete and write within body tags

Post by zyntrax »

Nice i think this will work well

Thanks.
User avatar
getmizanur
Forum Commoner
Posts: 71
Joined: Sun Sep 06, 2009 12:28 pm

Re: Delete and write within body tags

Post 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.
zyntrax
Forum Commoner
Posts: 32
Joined: Wed Apr 13, 2011 2:23 am
Location: Sweden

Re: Delete and write within body tags

Post by zyntrax »

I also found preg_replace, but first i'm going to see if i can make html dom work :)
Post Reply