htmlspecialchars()
Used to change HTML characters into ‘safer’ versions… i.e. for use in $_GET[], SQL injection, etc…
htmlspecialchars($myVariable, ENT_QUOTES, 'utf-8');
- ‘&’ (ampersand) becomes ‘&’
- ‘”‘ (double quote) becomes ‘"’ when ENT_NOQUOTES is not set.
- ”’ (single quote) becomes ‘'’ only when ENT_QUOTES is set.
- ‘<’ (less than) becomes ‘<’
- ‘>’ (greater than) becomes ‘>’