Jump to content

Find HTML tags and replace


meral

Recommended Posts

I have one string also having html tags...

 

<p>hello</p><b>bold</b><br /><p style="text-align:right">right align</p>

 

i want find all html tags and add space before and after that tag...

 

#<p>#hello#</p>##<b>#bold#</b>##<br />##<p style="text-align:right">#right align#</p>#

 

Consider # as white space

 

I think it can be achive through Regular Expression and preg_match but how i dont know...

 

please help ..

atleast give some idea..

Link to comment
https://forums.phpfreaks.com/topic/171149-find-html-tags-and-replace/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.