What exactly do you mean by "hexadecimal to byte"?
I am going to assume you mean "... to decimal".
The result of 0x3f
when output will be automatically converted to a decimal number. In internal calculations, it will be converted automatically if needed - you can do
$myvar = 300 + 0xfa;
without problems.
You can cast a variable to an integer using (int)$varname
or (int)value
but it doesn't really make sense in your case. A byte is a byte, whether you express its value as 0x3F
or 63
.
To convert hexadecimal to decimal, there is also
hexdec()
Returns the decimal equivalent of the hexadecimal number represented by the hex_string argument. hexdec() converts a hexadecimal string to a decimal number.