I want to save a 11 digit number inside a variable. How can I do this in PHP?
+5
A:
You could use the BC Math extension. Also, the 64-bit version of PHP uses 64-bit integers natively, so you could just use that if your hardware supports it. (There is no official 64-bit version, as far as I know, so I don't know how reliable it is.)
musicfreak
2010-04-26 06:02:04
@Jack says he only wants to save an 11 digit number. Handling it as a string may be a lot less of an overhead.
symcbean
2010-04-26 08:27:53
@symcbean: True, but if he wants to do math on that integer, he'll want a library like BC Math. I guess I made an assumption before answering, but I figured he wanted to do more than just store it in a variable.
musicfreak
2010-04-26 20:38:06
I don't know what you were referring to, but PHP does not support integers larger than 32 bits on 32-bit platforms. -1
musicfreak
2010-04-26 06:10:55