Last active
December 28, 2015 20:49
-
-
Save mguillermin/7560174 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ php -r "echo htmlentities(htmlspecialchars('œ … ’'));" | |
œ … ’ | |
$ php test.php | |
œ … ’ | |
$ php -v | |
PHP 5.4.21 (cli) (built: Nov 10 2013 14:14:11) | |
Copyright (c) 1997-2013 The PHP Group | |
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies | |
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans | |
$ php53 test53.php | |
$ php53 -v | |
PHP 5.3.27 (cli) (built: Oct 28 2013 09:19:43) | |
Copyright (c) 1997-2013 The PHP Group | |
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies | |
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo htmlentities(htmlspecialchars('œ … ’')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Il faut spécifier l'encoding pour PHP 5.3 (la valeur par défaut n'est pas UTF-8 dans cette version) | |
echo htmlentities(htmlspecialchars('œ … ’', ENT_COMPAT, 'UTF-8'), ENT_COMPAT, 'UTF-8'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment