PHP生成双拼域名列表

不言
풀어 주다: 2023-02-28 15:22:01
원래의
3642명이 탐색했습니다.

PHP生成双拼域名列表

心血来潮想要注册个好域名,想要个双拼域名,几乎都被抢注了。不知道有没有漏网之鱼。
一个一个试太麻烦了,所以才想做了这么一个小程序生成所有双拼域名列表,然后批量注册查询。|
废话少说,给出代码:

View Code

<?php
//PHP生成双拼域名列表

/* 分析:
-3
 12 13 21 22 23 31 32 33
a[0]a[0] a[0]a[1] a[0]a[2] a[1]a[1]
-4
 12 13 14 21 22 23 24 31 32 33 34 41 42 43 44
*/

//中文读音表
$a = explode(&#39; &#39;, 
&#39;a ai an ang ao ba bai ban bang bao bei ben beng bi bian biao bie bin bing bo bu ca cai can cang cao ce cen ceng cha chai chan chang chao che chen cheng chi chong chou chu chua chuai chuan chuang chui chun chuo ci cong cou cu cuan cui cun cuo da dai dan dang dao de den deng di dia dian diao die ding diu dong dou du duan dui dun duo e ei en eng er fa fan fang fei fen feng fo fou fu ga gai gan gang gao ge gei gen geng gong gou gu gua guai guan guang gui gun guo ha hai han hang hao he hei hen heng hong hou hu hua huai huan huang hui hun huo ji jia jian jiang jiao jie jin jing jiong jiu ju juan jue jun ka kai kan kang kao ke kei ken keng kong kou ku kua kuai kuan kuang kui kun kuo la lai lan lang lao le lei leng li lian liang liao lie lin ling liu lo long lou lu lü luan lue lüe lun luo lv m ma mai man mang mao me mei men meng mi mian miao mie min ming miu mo mou mu na nai nan nang nao ne nei nen neng ni nian niang niao nie nin ning niu nong nou nu nü nuan nue nun nuo nv o ou pa pai pan pang pao pei pen peng pi pian piao pie pin ping po pou pu qi qia qian qiang qiɑnwa qiao qie qin qing qiong qiu qu quan que qun ran rang rao re ren reng ri rong rou ru ruan rui run ruo sa sai san sang sao se sen seng sha shai shan shang shao she shen sheng shi shiwa shou shu shua shuai shuan shuang shui shun shuo si song sou su suan sui sun suo ta tai tan tang tao te teng ti tian tiao tie ting tong tou tu tuan tui tun tuo wa wai wan wang wei wen weng wo wu xi xia xian xiang xiao xie xin xing xiong xiu xu xuan xue xun ya yan yang yao ye yi yin ying yo yong you yu yuan yue yun za zai zan zang zao ze zei zen zeng zha zhai zhan zhang zhao zhe zhen zheng zhi zhong zhou zhu zhua zhuai zhuan zhuang zhui zhun zhuo zi zong zou zu zuan zui zun zuo&#39;
);

$n = count($a);
$b = array();

// print_r($a);
// echo($n);
// $n = 5;

for($i=0; $i<=$n-1; $i++) {
    for($j=0; $j<$n-1; $j++) {
        $b[] = $a[$i] . $a[$j];
    }
}

$b = formatArray($b);

$arr1 = array_map(&#39;addCom&#39;, $b);
$arr2 = array_map(&#39;addCn&#39;, $b);

//$arrDomain = $b;
$arrDomain = array_merge(array(), $arr1);
//$arrDomain = array_merge(array(), $arr1, $arr2);

$domain = implode("
\n", $arrDomain);
echo $domain;

/**
 * 删除数组中相同元素,只保留一个
 * @param array $array
 * @return array
 */ 
function formatArray($array)
{
    sort($array);
    $tem = &#39;&#39;;
    $temarray = array();
    $j = 0;
    for($i=0;$i
로그인 후 복사

精简整理后的代码:

<?php
//PHP生成双拼域名列表

set_time_limit(1800);

//中文读音表
$a = explode(&#39; &#39;, 
&#39;a ai an ang ao ba bai ban bang bao bei ben beng bi bian biao bie bin bing bo bu ca cai can cang cao ce cen ceng cha chai chan chang chao che chen cheng chi chong chou chu chua chuai chuan chuang chui chun chuo ci cong cou cu cuan cui cun cuo da dai dan dang dao de den deng di dia dian diao die ding diu dong dou du duan dui dun duo e ei en eng er fa fan fang fei fen feng fo fou fu ga gai gan gang gao ge gei gen geng gong gou gu gua guai guan guang gui gun guo ha hai han hang hao he hei hen heng hong hou hu hua huai huan huang hui hun huo ji jia jian jiang jiao jie jin jing jiong jiu ju juan jue jun ka kai kan kang kao ke kei ken keng kong kou ku kua kuai kuan kuang kui kun kuo la lai lan lang lao le lei leng li lian liang liao lie lin ling liu lo long lou lu lv luan lue lve lun luo lv m ma mai man mang mao me mei men meng mi mian miao mie min ming miu mo mou mu na nai nan nang nao ne nei nen neng ni nian niang niao nie nin ning niu nong nou nu nv nuan nue nun nuo nv o ou pa pai pan pang pao pei pen peng pi pian piao pie pin ping po pou pu qi qia qian qiang qiɑnwa qiao qie qin qing qiong qiu qu quan que qun ran rang rao re ren reng ri rong rou ru ruan rui run ruo sa sai san sang sao se sen seng sha shai shan shang shao she shen sheng shi shiwa shou shu shua shuai shuan shuang shui shun shuo si song sou su suan sui sun suo ta tai tan tang tao te teng ti tian tiao tie ting tong tou tu tuan tui tun tuo wa wai wan wang wei wen weng wo wu xi xia xian xiang xiao xie xin xing xiong xiu xu xuan xue xun ya yan yang yao ye yi yin ying yo yong you yu yuan yue yun za zai zan zang zao ze zei zen zeng zha zhai zhan zhang zhao zhe zhen zheng zhi zhong zhou zhu zhua zhuai zhuan zhuang zhui zhun zhuo zi zong zou zu zuan zui zun zuo&#39;
);

$n = count($a);
$b = array();

for($i=0; $i<=$n-1; $i++) {
    for($j=0; $j
로그인 후 복사


관련 라벨:
php
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿