// Generate a random 10 digit number and insert into mysql? echo mt_rand(1000000000, 9999999999); // http://stackoverflow.com/questions/23362930/generate-a-random-10-digit-number-and-insert-into-mysql