1--TEST-- 2Test mb_encode_numericentity() function : Convert UTF-8 to HTML-Entities 3--EXTENSIONS-- 4mbstring 5--FILE-- 6<?php 7$str1 = '¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'; 8$str2 = 'ƒΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρςστυφχψωϑϒϖ•…′″‾⁄℘ℑℜ™ℵ←↑→↓↔↵⇐⇑⇒⇓⇔∀∂∃∅∇∈∉∋∏∑−∗√∝∞∠∧∨∩∪∫∴∼≅≈≠≡≤≥⊂⊃⊄⊆⊇⊕⊗⊥⋅⌈⌉⌊⌋〈〉◊♠♣♥♦'; 9$convmap = array(0x0, 0x2FFFF, 0, 0xFFFF); 10echo mb_encode_numericentity($str1, $convmap, "UTF-8")."\n"; 11echo mb_encode_numericentity($str2, $convmap, "UTF-8")."\n"; 12 13$convmap = array(0xFF, 0x2FFFF, 0, 0xFFFF); 14echo mb_encode_numericentity('aŒbœcŠdše€fg', $convmap, "UTF-8")."\n"; 15 16$convmap = []; 17echo mb_encode_numericentity('föo', $convmap, "UTF-8")."\n"; 18 19$convmap = array(0xFF, 0x2FFFF, 0); // 3 elements 20try { 21 echo mb_encode_numericentity('aŒbœcŠdše€fg', $convmap, "UTF-8")."\n"; 22} catch (ValueError $ex) { 23 echo $ex->getMessage()."\n"; 24} 25?> 26--EXPECT-- 27¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ 28ƒΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρςστυφχψωϑϒϖ•…′″‾⁄℘ℑℜ™ℵ←↑→↓↔↵⇐⇑⇒⇓⇔∀∂∃∅∇∈∉∋∏∑−∗√∝∞∠∧∨∩∪∫∴∼≅≈≠≡≤≥⊂⊃⊄⊆⊇⊕⊗⊥⋅⌈⌉⌊⌋〈〉◊♠♣♥♦ 29aŒbœcŠdše€fg 30föo 31mb_encode_numericentity(): Argument #2 ($map) must have a multiple of 4 elements 32