0

I have been browsing through other "wrong int conversion" problems but I haven't found any posts related to mine.

I am converting a 10 char string (e.g '9052000000', '9056699999' ) to to type int, but I keep on getting the value 2147483647

my code looks something like this: $min = '9052000000'; $min = (int) $min;

Hope someone can help. Thanks!

Jules
  • 31
  • 5

3 Answers3

0

int length is depend on your system 32bit or 64bit.

Please read the manual for this:

[PHP Manual] http://www.php.net/manual/en/language.types.integer.php

skparwal
  • 1,086
  • 6
  • 15
0

You simply hit the limit of integer. Use GMP for abitrary length integers.

Markus Malkusch
  • 7,738
  • 2
  • 38
  • 67
0

Please read the manual for this:

[PHP Manual] http://id1.php.net/intval

Putra L Zendrato
  • 332
  • 3
  • 12