htmlent.phpt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. HTML input/output
  3. --EXTENSIONS--
  4. mbstring
  5. --SKIPIF--
  6. <?php
  7. ini_set('include_path', __DIR__);
  8. ?>
  9. --INI--
  10. output_buffering=4096
  11. output_handler=mb_output_handler
  12. zlib.output_compression=
  13. arg_separator.input=x
  14. error_reporting=0
  15. input_encoding=HTML-ENTITIES
  16. output_encoding=HTML-ENTITIES
  17. mbstring.encoding_translation=1
  18. filter.default=unsafe_raw
  19. --FILE--
  20. <?php
  21. // enable output encoding through output handler
  22. //ob_start("mb_output_handler");
  23. // &#64... are must be decoded on input these are not reencoded on output.
  24. // If you see &#64;&#65;&#66; on output this means input encoding fails.
  25. // If you do not see &auml;... on output this means output encoding fails.
  26. // Using UTF-8 internally allows to encode/decode ALL characters.
  27. // &128... will stay as they are since their character codes are above 127
  28. // and they do not have a named entity representation.
  29. ?>
  30. <?php echo mb_http_input('l').'>'.mb_internal_encoding().'>'.mb_http_output();?>
  31. <?php mb_parse_str("test=&#38;&#64;&#65;&#66;&#128;&#129;&#130;&auml;&ouml;&uuml;&euro;&lang;&rang;", $test);
  32. print_r($test);
  33. ?>
  34. --EXPECT--
  35. HTML-ENTITIES>UTF-8>HTML-ENTITIES
  36. Array
  37. (
  38. [test] => &@AB&#128;&#129;&#130;&auml;&ouml;&uuml;&euro;&lang;&rang;
  39. )