ascii to decimal
Posted: Mon Mar 29, 2010 8:21 am
Hi Everyone,
I have a value: �šš
which need to become: 0, 31, 22, -102, -102, 6
When is use ord
$code = "�šš";
echo(ord($code[0]));
echo(ord($code[1]));
echo(ord($code[2]));
echo(ord($code[3]));
echo(ord($code[4]));
echo(ord($code[5]));
The outcome = 0, 31, 22, 154, 154, 6
Could anyone help me out on this one?
The original code is in java and when using �šš it automaticly become's 0, 31, 22, -102, -102, 6 in a string.
Thanks in advance.
I have a value: �šš
which need to become: 0, 31, 22, -102, -102, 6
When is use ord
$code = "�šš";
echo(ord($code[0]));
echo(ord($code[1]));
echo(ord($code[2]));
echo(ord($code[3]));
echo(ord($code[4]));
echo(ord($code[5]));
The outcome = 0, 31, 22, 154, 154, 6
Could anyone help me out on this one?
The original code is in java and when using �šš it automaticly become's 0, 31, 22, -102, -102, 6 in a string.
Thanks in advance.