Learn R Programming

fun (version 0.4)

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)

Value

the string with special chars replaced.

Arguments

string

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

Author

Yihui Xie <https://yihui.org>

References

https://www.php.net/manual/en/function.htmlspecialchars.php

See Also

Examples

Run this code
htmlspecialchars("Yihui")
# <a href = 'https://yihui.org'>Yihui</a>

Run the code above in your browser using DataLab