Skip to content

Instantly share code, notes, and snippets.

@lechidung
Last active November 29, 2020 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lechidung/28efbeb4036bdf203271bc2b8ed5550b to your computer and use it in GitHub Desktop.
Save lechidung/28efbeb4036bdf203271bc2b8ed5550b to your computer and use it in GitHub Desktop.
php 8
/*** PHP 7 ***/
htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
/*** PHP 8 ***/
htmlspecialchars($string, double_encode: false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment