I am trying to store a phone number and I have reached some problems due to type casting? Anyone have any suggestions as to what is happening here?
var_dump((int)"6467838439"); // displays 'int 2147483647'
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
An integer is 32 bits and has a finite size of approximatly 2 billion so your phone number is being truncated. You should store it as a string.