<?php
// 函数用于生成所有可能的组合
function generateCombinations() {
$combinations = [];
// 纯英文组合
$letters = range('a', 'z');
foreach ($letters as $letter1) {
foreach ($letters as $letter2) {
$combinations[] = $letter1 . $letter2 . '.hk';
}
}
// 纯数字组合
$numbers = range(0, 9);
foreach ($numbers as $number1) {
foreach ($numbers as $number2) {
$combinations[] = $number1 . $number2 . '.hk';
}
}
// 英文数字混合组合
foreach ($letters as $letter1) {
foreach ($numbers as $number2) {
$combinations[] = $letter1 . $number2 . '.hk';
}
}
foreach ($numbers as $number1) {
foreach ($letters as $letter2) {
$combinations[] = $number1 . $letter2 . '.hk';
}
}
return array_unique($combinations); // 去除重复的组合
}
// 生成所有组合
$combinations = generateCombinations();
// 将组合写入文件
$file = fopen('combinations.txt', 'w');
foreach ($combinations as $combination) {
fwrite($file, $combination . PHP_EOL);
}
fclose($file);
echo "所有组合已生成并保存到 combinations.txt 文件中。";
?>
把.hk修改成你想要的后缀