i am using tiny_mce as a text editor for my CMS.
buy now the problem is it add <p> tag with data

so while retrieving the data for front end i get an extra space. so there is any why that i can remove <p> </p> from first paragraph.

i tried using strip_tags()... but it strip all the others tag like <br> etc etc..

I think rather than remove the tags manually, you should either tell tinymce not to put them there:

tinyMCE.init({
   forced_root_block : false,
   force_br_newlines : true,
   force_p_newlines : false
});

Or set the paragraph margins and padding to 0:

p {margin:0; padding: 0;}

Check out what they have to say about it.

But if you really want to strip those tags, you could try:

str_replace("</p>","<br />",str_replace("<p>", "", "YourString"));

Might be a better way but that should work.

Thanks Mate....

I think rather than remove the tags manually, you should either tell tinymce not to put them there:

tinyMCE.init({
   forced_root_block : false,
   force_br_newlines : true,
   force_p_newlines : false
});

Or set the paragraph margins and padding to 0:

p {margin:0; padding: 0;}

Check out what they have to say about it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.