I am very new face to PHP. I read that dechex(255)
will give the corresponding hex value ff
in PHP.
I need the hex value of -105
. I tried dechex(-105)
and got the result as ffffff97
. But I just only want 97
to do some kind of stuffs.
In Java I know that a bit wise operation with 0xff
gave us the result 97
that is (byte)-105 & (byte)0xff = 0x97
.
Please to find the solution in PHP just like I've done in Java.