3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $utf8_to_iso8859_1_translation_table = array( ); $utf8_to_iso8859_1_translation_table2 = array( ); for( $a = 0; $a<256; $a++ ) { $iso_8859_1 = mb_convert_encoding( "&#$a;" , 'ISO-8859-1' , 'HTML-ENTITIES' ); $utf8 = mb_convert_encoding( $iso_8859_1 , 'UTF-8' , 'ISO-8859-1' ); //$utf8 = utf8_encode( $iso_8859_1 ); $xutf8 = ( '\x' . dechex( ord( $utf8[0] ) ) . ( isset( $utf8[1] ) ? '\x' . dechex( ord( $utf8[1] ) ) . ( isset( $utf8[2] ) ? '\x' . dechex( ord( $utf8[2] ) ) : '' ) : '' ) ); $xiso = ( '\x' . dechex( ord( $iso_8859_1[0] ) ) . ( isset( $iso_8859_1[1] ) ? '\x' . dechex( ord( $utf8[1] ) ) : '' ) ); $utf8_to_iso8859_1_translation_table[$xutf8] = $xiso;// . ' ' . $a; $utf8_to_iso8859_1_translation_table2[$utf8] = $iso_8859_1;// . ' ' . $a; } //print_r( $utf8_to_iso8859_1_translation_table ); print_r( $utf8_to_iso8859_1_translation_table2 ); die;
Output for 5.3.0 - 7.1.0
Array ( [] => [] =>  [] =>  [] =>  [] =>  [] =>  [] =>  [] =>  [] =>  [ ] => [ ] => [ ] => [ ] => [ ] => [] =>  [] =>  [] =>  [] =>  [] =>  [] =>  [] =>  [] =>  [] =>  [] =>  [] =>  [] =>  [] =>  [] =>  [] =>  [] =>  [] =>  [] =>  [ ] => [!] => ! ["] => " [#] => # [$] => $ [%] => % [&] => & ['] => ' [(] => ( [)] => ) [*] => * [+] => + [,] => , [-] => - [.] => . [/] => / [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 [6] => 6 [7] => 7 [8] => 8 [9] => 9 [:] => : [;] => ; [<] => < [=] => = [>] => > [?] => ? [@] => @ [A] => A [B] => B [C] => C [D] => D [E] => E [F] => F [G] => G [H] => H [I] => I [J] => J [K] => K [L] => L [M] => M [N] => N [O] => O [P] => P [Q] => Q [R] => R [S] => S [T] => T [U] => U [V] => V [W] => W [X] => X [Y] => Y [Z] => Z [[] => [ [\] => \ []] => ] [^] => ^ [_] => _ [`] => ` [a] => a [b] => b [c] => c [d] => d [e] => e [f] => f [g] => g [h] => h [i] => i [j] => j [k] => k [l] => l [m] => m [n] => n [o] => o [p] => p [q] => q [r] => r [s] => s [t] => t [u] => u [v] => v [w] => w [x] => x [y] => y [z] => z [{] => { [|] => | [}] => } [~] => ~ [] =>  [€] => � [] => � [‚] => � [ƒ] => � [„] => � […] => � [†] => � [‡] => � [ˆ] => � [‰] => � [Š] => � [‹] => � [Œ] => � [] => � [Ž] => � [] => � [] => � [‘] => � [’] => � [“] => � [”] => � [•] => � [–] => � [—] => � [˜] => � [™] => � [š] => � [›] => � [œ] => � [] => � [ž] => � [Ÿ] => � [ ] => � [¡] => � [¢] => � [£] => � [¤] => � [¥] => � [¦] => � [§] => � [¨] => � [©] => � [ª] => � [«] => � [¬] => � [­] => � [®] => � [¯] => � [°] => � [±] => � [²] => � [³] => � [´] => � [µ] => � [¶] => � [·] => � [¸] => � [¹] => � [º] => � [»] => � [¼] => � [½] => � [¾] => � [¿] => � [À] => � [Á] => � [Â] => � [Ã] => � [Ä] => � [Å] => � [Æ] => � [Ç] => � [È] => � [É] => � [Ê] => � [Ë] => � [Ì] => � [Í] => � [Î] => � [Ï] => � [Ð] => � [Ñ] => � [Ò] => � [Ó] => � [Ô] => � [Õ] => � [Ö] => � [×] => � [Ø] => � [Ù] => � [Ú] => � [Û] => � [Ü] => � [Ý] => � [Þ] => � [ß] => � [à] => � [á] => � [â] => � [ã] => � [ä] => � [å] => � [æ] => � [ç] => � [è] => � [é] => � [ê] => � [ë] => � [ì] => � [í] => � [î] => � [ï] => � [ð] => � [ñ] => � [ò] => � [ó] => � [ô] => � [õ] => � [ö] => � [÷] => � [ø] => � [ù] => � [ú] => � [û] => � [ü] => � [ý] => � [þ] => � [ÿ] => � )