重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
这篇文章主要为大家展示了“php如何为运维主机生成不同的随机秘钥”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“php如何为运维主机生成不同的随机秘钥”这篇文章吧。
创新互联专注于企业成都营销网站建设、网站重做改版、海城网站定制设计、自适应品牌网站建设、H5场景定制、成都商城网站开发、集团公司官网建设、成都外贸网站建设、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为海城等各大城市提供网站开发制作服务。
'123.57.221.66'),array('pay_web'=>'101.201.222.104'),array('video_web'=>'101.201.31.40'),array('bg_web211'=>'123.56.181.211'),array('quanzi'=>'101.201.55.37'),array('bg_web231'=>'60.205.127.231'),array('db2_master'=>'60.205.166.72'),array('db2_slave'=>'60.205.166.74'),array('db3_others'=>'59.110.11.16'),array('test_web'=>'60.205.150.53'),array('nfs1_redis2'=>'123.57.184.167'),array('nfs1_redis1'=>'123.57.184.235'),array('zhuanfaqi'=>'123.57.185.38'),array('prepare_web'=>'59.110.8.82'),array('bg_web64'=>'10.29.130.64')); //define("HOSTS",array('123.57.221.66','101.201.222.104','101.201.31.40','123.56.181.211','101.201.55.37','60.205.127.231','60.205.166.72','60.205.166.74','59.110.11.16','60.205.150.53','123.57.184.167','123.57.184.235','123.57.185.38','59.110.8.82','10.29.130.64')); const HOSTS = array('123.57.203.66','101.101.222.104','102.221.51.40','112.56.131.211','121.202.45.37','101.205.127.231','101.205.166.72','63.205.166.74','39.110.13.12','65.205.150.53','33.57.134.167','123.59.104.235','148.57.135.38','59.190.8.77','10.29.130.52'); const HOSTNAMES = array('ubuntu','pay_web104','video_web40','bg_web211','quanzi37','bg_web231','db2_master72','db2_slave74','db3_others','test_web','nfs1_redis1','nfs2_redis2','zhuanfaqi','prepare_web','bg_web64'); // 密码生成器函数 public function generator_pass(){ $time = time(); //$md5($string); md5 函数也可以为字符串生成一个随机的值 $string = $time . "!@#$%^&"; $string1 = str_shuffle($string); //$password = chunk_split($string1,9); 会在第9个位置插入一个指定的字符串 $password = mb_substr($string1,0,12); return $password; //var_dump($string1."\n"); //var_dump($password."\n"); } // 为主机生成密码并记录日志 public function produce_pass_for_hosts(){ $new_hosts = array(); $hosts = generator1::HOSTS; $hostnames = generator1::HOSTNAMES; for($i=0;$igenerator_pass(); } return $new_hosts; } } $gen = new generator1(); $host_info = $gen->produce_pass_for_hosts(); var_dump($host_info); ?>
以上是“php如何为运维主机生成不同的随机秘钥”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!