Remove <p> </p> tags

4 posts by 3 authors in: Forums > CMS Builder
Last Post: April 16, 2015   (RSS)

By KCMedia - April 9, 2015

Hi Guys

I have this text block

<p class="text"><?php echo ($record['content']) ?></p>

but i need to remove all the <p> </p> tags from the statement inside the content, it is using WYSIWYG and i cant change it to text block because it needs to be able to bold font and underline and so on.

Thanks



Craig

KC Media Solutions

www.kcmedia.biz

By KCMedia - April 9, 2015

Hi Jerry

yer i have tried that the issue is that it removes the first <p> tag which is great BUT because when you put a line break in WYSIWYG in the source code it dosnt put the class of the <p> tag

eg the first P tag and all P in the div should be <p class="text"> content goes in here </p> and then the next P should be the same.

Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Hey Craig,

I just want to confirm what you're trying to achieve. Do you want to remove all of the opening / closing p tags from a bock of text, and replace them with line breaks? Or do you want to add the class text to each p tag in the block?

I'm wondering if there is a simpler way to do this using CSS instead of doing a find and replace with PHP. Perhaps wrapping the content with a div instead of a p tag, then styling the p tags inside the div instead would work?

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com