If i want to convert all strings special characters to html-entites, but leave all the tags intact, what do i need to do?
Like:
aaa<b>ccÄdd</b>aa
would become:
aaa<b>cc&AUML;dd</b>aa
[SOLVED] Strip_html
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
[php_man]htmlentities[/php_man]
edit - beaten to it by feyd.... errrrrr
edit - beaten to it by feyd.... errrrrr
Last edited by John Cartwright on Sun Oct 10, 2004 7:32 pm, edited 1 time in total.
-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
Thanks, i made a function to do some str_replace to undo "<" ">" "/" loss...feyd wrote:[php_man]htmlentities[/php_man]() with a [php_man]str_replace[/php_man]() or two to "fix" the <> marks.
can also be done with a regular expression: [php_man]preg_replace[/php_man]() ... however, it may be more a pain to set up than it's worth.