Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

htmlentities() does NOT work with html entities

Hello,

I need to clean user-inputed text so I use htmlentities() however it does NOT work if html entities have already been provided.

Here is an example:

         echo htmlentities("Copyright © 2007    CompanyName®");

How should I solve this?
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Vel Eous
Vel Eous

htmlentities only takes the HTML tags and replaces them with their markup eqivalents.

Try using the PHP strip_tags method:

http://uk3.php.net/strip-tags