String to Int problems

Hi I appreciate your help, the code is kinda simple actually but I’m having trouble

The following code echo’s the WRONG result

a5611bcd::0::0::abccef01

I need this following result

a5611bcd::fffafaff::fefffeef::abccef01

I suspect the issue is that those two middle values are too large for integer, I know about bcmath, but whats the best way to get correct results into INTEGER form… must be integer form, basically I

my variables below are closely named sorry about this…

<?php $KEY = array(0xA5611BCD,0xFFFAFAFF,0xFEFFFEEF,0xABCCEF01); /*this is the model of how everything below should end up in $SKEY $KEY = array(0xA5611BCD,0xFFFAFAFF,0xFEFFFEEF,0xABCCEF01); */ //so I begin with this string $getSKEY and try to make it into the above model $getSKEY = "A5611BCDFFFAFAFFFEFFFEEFABCCEF01"; $SKEY = array( hexdec(substr($getSKEY,0,8)), hexdec(substr($getSKEY,8,16)), hexdec(substr($getSKEY,16,24)), hexdec(substr($getSKEY,24,32)) ); echo dechex($SKEY[0])."::". dechex($SKEY[1])."::". dechex($SKEY[2])."::". dechex($SKEY[3]) ; ?>
Sponsor our Newsletter | Privacy Policy | Terms of Service