Databug

Thursday, May 18, 2006

Zip Code and Phone Methods

I've added methods to generate a random city, state, and zip pulled from a flat file I adapted from US census data. I also have a flat file of select US area codes, useful for generating phone numbers. The area code list includes values for the second three phone number digits (what's the word for that?), but I have a 'safe' flag that automatically sets this to '555' to help avoid publishing real phone numbers.

Both methods can be keyed to state and thus can be coordinated for greater verisimilitude. I have a function somewhere for generating a street name (using the last name database). I'll have to integrate that in order to generate a full street address.

A sample generated data array:

Array
(
[first_name] => averil
[last_name] => malcolm
[user_name] => amalcolm
[full_name] => averil malcolm
[gender] => f
[email] => amalcolm11041@sbcglobal.net
[zip] => 38018
[city] => Cordova
[state] => TN
[phone] => (901) 555-6329
)

 

0 Comments:

Post a Comment

<< Home