Jump to content

Archived

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

rodin

strip_tags while keeping only font color=

Recommended Posts

I want to strip all html tags, EXCEPT want to keep the BOLD and the actual font color= , while getting rid of font size and font face, so where right now I get
[code]
<font face="Verdana" size=2>
<b><font color="#00FFFF">rodin</font></b>
[/code]

I've accomplished keeping the bold, by using the strip_tags then < b >, but haven't accomplished keeping just the font COLOR and closing the font COLOR.  Is this possible as well?

Thanks for the great support here!

Share this post


Link to post
Share on other sites
[code]<?php

$string = strip_tags($string, '<font>');

?>[/code]

It helps to read the manual.

Share this post


Link to post
Share on other sites
Jenk,

He only wants to keep parts of the [b]<font>[/b] tag, not all of it...

It helps to read the post  ;D

Having said that, there is a good example on the manual page that a user has posted on how to achieve what you want.

Regards
Huggie

Share this post


Link to post
Share on other sites
[quote]Having said that, there is a good example on the manual page that a user has posted on how to achieve what you want. [/quote] ;)

Share this post


Link to post
Share on other sites
Yes no need to be a smarty pants ;)  I even tried to find the answer myself via google and many other means before posing the question ;)

Share this post


Link to post
Share on other sites

×

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.