Are there any scripts that can convert between text (e.g. <hi>
) and the html entities version (<hi>
) like this website does? Or at least a PHP file?
How to convert to HTML code
character encodingcommand lineconversionhtml
character encodingcommand lineconversionhtml
Are there any scripts that can convert between text (e.g. <hi>
) and the html entities version (<hi>
) like this website does? Or at least a PHP file?
Best Answer
The perl CGI module has a
escapeHTML
function that makes it pretty easy:Or to do an entire file: