分享一个自己写的自动生成的2位数带后缀扫米字符php脚本 [复制链接]

帖子链接已复制到剪贴板
丁真 (UID: 4838) 4月前
帖子已经有人评论啦,不支持删除!

1226 11
<?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修改成你想要的后缀

奶狗博客 naigou.cn
已有评论 (11)
提示:您必须 登录 才能查看此内容。
创建新帖
广告推广点击空位自助购买