in a wordpress php script, I have the following:
echo \'
\' . \
-
If you're outputting raw HTML to a HTML document (and you want it shown as text
instead of text), you can use htmlentities($string):
htmlentities($slide_media);
If your string is UTF8, you might have to specify this (if your PHP version is 5.4+, you don't have to specify UTF-8, as it's default):
htmlentities($slide_media, ENT_QUOTES, "UTF-8");
You can also strip all HTML tags from the variable by using strip_tags($string):
strip_tags($slide_media);
- 热议问题