LoginSignup
5
5

More than 5 years have passed since last update.

#PHP 5.4以降で html_entity_decode() を用いて `'` を `'` に decode する

Posted at

ENT_QUOTES だけでは '' にならない

php
echo htmlentities("'", ENT_QUOTES);// '
echo html_entity_decode("''", ENT_QUOTES); // ''

PHP 5.4以降ならば、flagsにENT_HTML5を加える

php
echo htmlentities("'", ENT_QUOTES | ENT_HTML5);// '
echo html_entity_decode("''", ENT_QUOTES | ENT_HTML5); // ''

参考

5
5
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5