How to escape special characters in php?
The function converts special characters into HTML entities, (html will no longer work so you can echo it outside).
1. Code:
'; echo escapeSpecialChars($str); echo " Soltuts ]]> Soltuts
"; ?>
2. Example:
Input:
$str = ''; Soltuts ]]> Soltuts
Output:
Soltuts ]]> Soltuts