Skip to content

Instantly share code, notes, and snippets.

@panfeng
Created October 27, 2014 13:38
Show Gist options
  • Save panfeng/15cd66901fbc2521dba3 to your computer and use it in GitHub Desktop.
Save panfeng/15cd66901fbc2521dba3 to your computer and use it in GitHub Desktop.
<?php
function pre_print_r($var){ echo "<pre>"; print_r($var); echo "</pre>"; echo "<br />"; };
$tmpa = 'Ägypten';
$tmpb = 'Österreich';
$tmpc = 'ÜbereinfuhrÜ';
$d = str_split($tmpa);
$e = str_split($tmpb);
$f = str_split($tmpc);
pre_print_r($d);
pre_print_r($d[0]);
pre_print_r(bin2hex($d[0]));
pre_print_r($e);
pre_print_r($e[0]);
pre_print_r(bin2hex($e[0]));
pre_print_r($f);
pre_print_r($f[0]);
pre_print_r(bin2hex($f[0]));
pre_print_r(bin2hex($tmpa));
pre_print_r(bin2hex($tmpa[0]));
pre_print_r(bin2hex($tmpb));
pre_print_r(bin2hex($tmpb[0]));
pre_print_r(bin2hex($tmpc));
pre_print_r(bin2hex($tmpc[0]));
/*
Array
(
[0] => Ã
[1] => „
[2] => g
[3] => y
[4] => p
[5] => t
[6] => e
[7] => n
)
Ã
c3
Array
(
[0] => Ã
[1] => –
[2] => s
[3] => t
[4] => e
[5] => r
[6] => r
[7] => e
[8] => i
[9] => c
[10] => h
)
Ã
c3
Array
(
[0] => Ã
[1] => œ
[2] => b
[3] => e
[4] => r
[5] => e
[6] => i
[7] => n
[8] => f
[9] => u
[10] => h
[11] => r
[12] => Ã
[13] => œ
)
Ã
c3
c38467797074656e
c3
c396737465727265696368
c3
c39c62657265696e66756872c39c
c3
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment