1--TEST-- 2Test get_html_translation_table() function : basic functionality - charset WINDOWS-1252 3--FILE-- 4<?php 5/* Prototype : array get_html_translation_table ( [int $table [, int $quote_style [, string charset_hint]]] ) 6 * Description: Returns the internal translation table used by htmlspecialchars and htmlentities 7 * Source code: ext/standard/html.c 8*/ 9 10 11echo "*** Testing get_html_translation_table() : basic functionality/Windows-1252 ***\n"; 12 13echo "-- with table = HTML_ENTITIES --\n"; 14$table = HTML_ENTITIES; 15var_dump( get_html_translation_table($table, ENT_COMPAT, "WINDOWS-1252") ); 16 17echo "-- with table = HTML_SPECIALCHARS --\n"; 18$table = HTML_SPECIALCHARS; 19var_dump( get_html_translation_table($table, ENT_COMPAT, "WINDOWS-1252") ); 20 21echo "Done\n"; 22?> 23--EXPECTF-- 24*** Testing get_html_translation_table() : basic functionality/Windows-1252 *** 25-- with table = HTML_ENTITIES -- 26array(125) { 27 ["�"]=> 28 string(6) "€" 29 ["�"]=> 30 string(7) "‚" 31 ["�"]=> 32 string(6) "ƒ" 33 ["�"]=> 34 string(7) "„" 35 ["�"]=> 36 string(8) "…" 37 ["�"]=> 38 string(8) "†" 39 ["�"]=> 40 string(8) "‡" 41 ["�"]=> 42 string(6) "ˆ" 43 ["�"]=> 44 string(8) "‰" 45 ["�"]=> 46 string(8) "Š" 47 ["�"]=> 48 string(8) "‹" 49 ["�"]=> 50 string(7) "Œ" 51 ["�"]=> 52 string(7) "‘" 53 ["�"]=> 54 string(7) "’" 55 ["�"]=> 56 string(7) "“" 57 ["�"]=> 58 string(7) "”" 59 ["�"]=> 60 string(6) "•" 61 ["�"]=> 62 string(7) "–" 63 ["�"]=> 64 string(7) "—" 65 ["�"]=> 66 string(7) "˜" 67 ["�"]=> 68 string(7) "™" 69 ["�"]=> 70 string(8) "š" 71 ["�"]=> 72 string(8) "›" 73 ["�"]=> 74 string(7) "œ" 75 ["�"]=> 76 string(6) "Ÿ" 77 ["�"]=> 78 string(6) " " 79 ["�"]=> 80 string(7) "¡" 81 ["�"]=> 82 string(6) "¢" 83 ["�"]=> 84 string(7) "£" 85 ["�"]=> 86 string(8) "¤" 87 ["�"]=> 88 string(5) "¥" 89 ["�"]=> 90 string(8) "¦" 91 ["�"]=> 92 string(6) "§" 93 ["�"]=> 94 string(5) "¨" 95 ["�"]=> 96 string(6) "©" 97 ["�"]=> 98 string(6) "ª" 99 ["�"]=> 100 string(7) "«" 101 ["�"]=> 102 string(5) "¬" 103 ["�"]=> 104 string(5) "­" 105 ["�"]=> 106 string(5) "®" 107 ["�"]=> 108 string(6) "¯" 109 ["�"]=> 110 string(5) "°" 111 ["�"]=> 112 string(8) "±" 113 ["�"]=> 114 string(6) "²" 115 ["�"]=> 116 string(6) "³" 117 ["�"]=> 118 string(7) "´" 119 ["�"]=> 120 string(7) "µ" 121 ["�"]=> 122 string(6) "¶" 123 ["�"]=> 124 string(8) "·" 125 ["�"]=> 126 string(7) "¸" 127 ["�"]=> 128 string(6) "¹" 129 ["�"]=> 130 string(6) "º" 131 ["�"]=> 132 string(7) "»" 133 ["�"]=> 134 string(8) "¼" 135 ["�"]=> 136 string(8) "½" 137 ["�"]=> 138 string(8) "¾" 139 ["�"]=> 140 string(8) "¿" 141 ["�"]=> 142 string(8) "À" 143 ["�"]=> 144 string(8) "Á" 145 ["�"]=> 146 string(7) "Â" 147 ["�"]=> 148 string(8) "Ã" 149 ["�"]=> 150 string(6) "Ä" 151 ["�"]=> 152 string(7) "Å" 153 ["�"]=> 154 string(7) "Æ" 155 ["�"]=> 156 string(8) "Ç" 157 ["�"]=> 158 string(8) "È" 159 ["�"]=> 160 string(8) "É" 161 ["�"]=> 162 string(7) "Ê" 163 ["�"]=> 164 string(6) "Ë" 165 ["�"]=> 166 string(8) "Ì" 167 ["�"]=> 168 string(8) "Í" 169 ["�"]=> 170 string(7) "Î" 171 ["�"]=> 172 string(6) "Ï" 173 ["�"]=> 174 string(5) "Ð" 175 ["�"]=> 176 string(8) "Ñ" 177 ["�"]=> 178 string(8) "Ò" 179 ["�"]=> 180 string(8) "Ó" 181 ["�"]=> 182 string(7) "Ô" 183 ["�"]=> 184 string(8) "Õ" 185 ["�"]=> 186 string(6) "Ö" 187 ["�"]=> 188 string(7) "×" 189 ["�"]=> 190 string(8) "Ø" 191 ["�"]=> 192 string(8) "Ù" 193 ["�"]=> 194 string(8) "Ú" 195 ["�"]=> 196 string(7) "Û" 197 ["�"]=> 198 string(6) "Ü" 199 ["�"]=> 200 string(8) "Ý" 201 ["�"]=> 202 string(7) "Þ" 203 ["�"]=> 204 string(7) "ß" 205 ["�"]=> 206 string(8) "à" 207 ["�"]=> 208 string(8) "á" 209 ["�"]=> 210 string(7) "â" 211 ["�"]=> 212 string(8) "ã" 213 ["�"]=> 214 string(6) "ä" 215 ["�"]=> 216 string(7) "å" 217 ["�"]=> 218 string(7) "æ" 219 ["�"]=> 220 string(8) "ç" 221 ["�"]=> 222 string(8) "è" 223 ["�"]=> 224 string(8) "é" 225 ["�"]=> 226 string(7) "ê" 227 ["�"]=> 228 string(6) "ë" 229 ["�"]=> 230 string(8) "ì" 231 ["�"]=> 232 string(8) "í" 233 ["�"]=> 234 string(7) "î" 235 ["�"]=> 236 string(6) "ï" 237 ["�"]=> 238 string(5) "ð" 239 ["�"]=> 240 string(8) "ñ" 241 ["�"]=> 242 string(8) "ò" 243 ["�"]=> 244 string(8) "ó" 245 ["�"]=> 246 string(7) "ô" 247 ["�"]=> 248 string(8) "õ" 249 ["�"]=> 250 string(6) "ö" 251 ["�"]=> 252 string(8) "÷" 253 ["�"]=> 254 string(8) "ø" 255 ["�"]=> 256 string(8) "ù" 257 ["�"]=> 258 string(8) "ú" 259 ["�"]=> 260 string(7) "û" 261 ["�"]=> 262 string(6) "ü" 263 ["�"]=> 264 string(8) "ý" 265 ["�"]=> 266 string(7) "þ" 267 ["�"]=> 268 string(6) "ÿ" 269 ["&"]=> 270 string(5) "&" 271 ["""]=> 272 string(6) """ 273 ["<"]=> 274 string(4) "<" 275 [">"]=> 276 string(4) ">" 277} 278-- with table = HTML_SPECIALCHARS -- 279array(4) { 280 ["&"]=> 281 string(5) "&" 282 ["""]=> 283 string(6) """ 284 ["<"]=> 285 string(4) "<" 286 [">"]=> 287 string(4) ">" 288} 289Done 290