fork download
  1. <?php
  2.  
  3. $text = "äöü <&auml; '' &ouml; &uuml; &#223;";
  4. var_dump($text);
  5. var_dump(ref);
  6. var_dump(mb_convert_encoding($text, 'HTML-ENTITIES', 'UTF-8'));
  7.  
  8. $text = "äöü <&auml; '' &ouml; &uuml; &#223;";
  9. var_dump(geil);
  10. var_dump(htmlspecialchars_decode(htmlentities($text, ENT_NOQUOTES, 'UTF-8'), ENT_NOQUOTES));
  11.  
Success #stdin #stdout #stderr 0.04s 26168KB
stdin
Standard input is empty
stdout
string(38) "äöü <&auml; '' &ouml; &uuml; &#223;"
string(3) "ref"
string(50) "&auml;&ouml;&uuml; <&auml; '' &ouml; &uuml; &#223;"
string(4) "geil"
string(50) "&auml;&ouml;&uuml; <&auml; '' &ouml; &uuml; &#223;"
string(50) "&auml;&ouml;&uuml; <&auml; '' &ouml; &uuml; &#223;"
stderr
PHP Warning:  Use of undefined constant ref - assumed 'ref' (this will throw an Error in a future version of PHP) in /home/cMqfj6/prog.php on line 5
PHP Warning:  Use of undefined constant geil - assumed 'geil' (this will throw an Error in a future version of PHP) in /home/cMqfj6/prog.php on line 9