Automatically replace "&" with "&" [duplicate]
Possible Duplicate:
replace & for &
For a wordpress page to be v开发者_开发知识库alidated, all &
should be replaced with &
I know java but i do not know PHP. So how do i do this in wordpress?
Use htmlspecialchars
before printing:
$text = htmlspecialchars($text)
You can escape ampersands &
as well as quotes and brackets using the htmlspecialchars()
function.
Like the others said, htmlspecialchars()
works. Also check out htmlentities()
which has a broader range of characters to replace for further scrubbing of the string.
精彩评论