im currently writing functions to convert htmlspecialchars (which i convert all characters to before it is uploaded to the database for security purposes and to keep the html valid to strict)
would this be an effective function for putting links back in?
[code=php]
function htmllink($text)
{
str_replace(‘<a href="’, ‘<a href=”‘, $text);
str_replace(‘">’, ‘”>’, $text);
str_replace(‘</a>’, ‘</a>’, $text);
}
or is there a more effective way?
also is there an easy way to be able to display htmlspecialchars for somethings and not others (to display code not have the browser read he html for some things but actually process the html for others)
e.g
have the options to have <a href=”blah”>blah</a>
and <a href="blah">blah</a>