Question using intVal(0x000783633A596945)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stanster
Forum Newbie
Posts: 1
Joined: Mon Aug 03, 2009 12:09 pm

Question using intVal(0x000783633A596945)

Post by stanster »

I have a string literal like so 000783633A596945 that I need to convert to hex (pre-pend 0x) and then get the intVal of - the problem is that converting from the String value using intVal('0x'+'000783633A596945') is not the same as intVal(0x000783633A596945) which is what I need (without quotes).

Does anyone have any ideas as to how I should go abut doing this?

$token = '000783633A596945';
$tokenHex = '0x'. '000783633A596945';
intVal(0x000783633A596945);

Thanks
A
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: Question using intVal(0x000783633A596945)

Post by Mark Baker »

An intval should only fall within the maximum integer range for your server - (32 bit or 64 bit). Your string literal looks rather too long even for a 64-bit machine
Post Reply