Skip to content

Instantly share code, notes, and snippets.

@appastair
Created April 6, 2013 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save appastair/5326878 to your computer and use it in GitHub Desktop.
Save appastair/5326878 to your computer and use it in GitHub Desktop.
Generate Australian Phone Number Lists
<?php
/* Number Prefix Source: http://en.wikipedia.org/wiki/Telephone_numbers_in_Australia#Mobile_phone_numbers_.2804.29 */
$mobile_prefixes = array('0400', '0401', '0402', '0403', '0404', '0405', '0406', '0407', '0408', '0409', '0410', '0411', '0412', '0413', '0414', '0415', '0416', '0417', '0418', '0419', '0420', '0421', '0422', '0423', '0424', '0425', '0427', '0428', '0429', '0430', '0431', '0432', '0433', '0434', '0435', '0437', '0438', '0439', '0440', '0446', '0447', '0448', '0449', '0488', '0450', '0451');
foreach($mobile_prefixes as $mobile_prefix){
for($number = 0; strlen($number) < 7; ++$number){
echo $mobile_prefix.str_pad($number, 6, '0', STR_PAD_LEFT)."\n";
}
}
?>
<?php
/* Number Prefix Source: http://en.wikipedia.org/wiki/Telephone_numbers_in_Australia#Geographic_numbers_2 */
$prefixes = array(
'023','024','025','026','027','028','029', /* Central East */
'034','035','036','037','038','039', /* South East */
'072','073','074','075','077', /* North East */
'085','086','087','088','089' /* Central+West */
);
foreach($prefixes as $prefix){
for($number = 0; strlen($number) < 8; $number++){
echo $prefix.str_pad($number, 7, '0', STR_PAD_LEFT)."\n";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment