fun (version 0.2)

htmlspecialchars: Replace HTML special characters with HTML entities

Description

The characters c("&", '"', "'", "<", ">") will be replaced with c("&amp;", "&quot;", "&#039;", "&lt;", "&gt;"), respectively.

Usage

htmlspecialchars(string)

Arguments

string

the string with (or w/o) HTML special chars

Value

the string with special chars replaced.

References

http://php.net/manual/en/function.htmlspecialchars.php

See Also

gsub

Examples

Run this code
# NOT RUN {
htmlspecialchars("<a href = 'http://yihui.name'>Yihui</a>")
# <a href = 'http://yihui.name'>Yihui</a>
# }

Run the code above in your browser using DataLab