fork download
  1. <?php
  2.  
  3. $text = "<html><body><h1>Nueva versión </h1><h3><span>Click here</span> to edit this text or paste your document here to&nbsp;convert&nbsp;it&nbsp;to&nbsp;HTML</h3></body></html>";
  4. var_dump(mb_convert_encoding($text, 'UTF-8', 'HTML-ENTITIES'));
  5.  
  6. $text = "äöü &auml; &ouml; &uuml; &#223;";
  7. var_dump(html_entity_decode($text, ENT_COMPAT | ENT_HTML401, 'UTF-8'));
  8.  
Success #stdin #stdout 0.03s 25264KB
stdin
Standard input is empty
stdout
string(156) "<html><body><h1>Nueva versión </h1><h3><span>Click here</span> to edit this text or paste your document here to convert it to HTML</h3></body></html>"
string(18) "äöü ä ö ü ß"