Skip to content

Instantly share code, notes, and snippets.

@tobiastom
Created November 4, 2009 21:29
Show Gist options
  • Select an option

  • Save tobiastom/226406 to your computer and use it in GitHub Desktop.

Select an option

Save tobiastom/226406 to your computer and use it in GitHub Desktop.
<?php
function generateEmail() {
$nameLength = rand(5, 9);
$name = '';
for($x = 0; $x < $nameLength; $x++) {
$name .= chr(rand(97, 122));
}
$domainLength = rand(3, 9);
$domain = '';
for($x = 0; $x < $domainLength; $x++) {
$domain .= chr(rand(97, 122));
}
$tdls = array('de', 'com', 'co.uk', 'net');
$tdl = $tdls[rand(0, count($tdls) - 1)];
return $name.'@'.$domain.'.'.$tdl;
}
for($x = 0; $x < 100; $x++) {
print generateEmail()."\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment