If the data type of the phone number column is 'int' then you are in trouble. Why wouldn't you just change it to text? Oh, if you are carefully (and
correctly) restricting user's data entry of phone numbers to those matching the North American Numbering scheme, (nnn-nnn-nnnn) then I guess you could just do
printf("%010d", $phone_as_int );
and have it stick the leading zeros in, but if all the phone numbers in your database aren't exactly the same number of (original) digits then you are still in trouble.