try
$decvalue = hexdec(substr($the_string, 0, 5));
Question
I have a 128 character hex string.
I need to get the first 5 characters and then convert them to a decimal, which I will do with hexdec()
How can I get the first 5 characters?
Solution
try
$decvalue = hexdec(substr($the_string, 0, 5));
OTHER TIPS
1)use substr to get 5 digits
$value = substr($yourstring, 0, 5);
2)Then convert them to decimal