《PHP應(yīng)用:PHP實(shí)現(xiàn)的隨機(jī)IP函數(shù)【國(guó)內(nèi)IP段】》要點(diǎn):
本文介紹了PHP應(yīng)用:PHP實(shí)現(xiàn)的隨機(jī)IP函數(shù)【國(guó)內(nèi)IP段】,希望對(duì)您有用。如果有疑問,可以聯(lián)系我們。
PHP編程本文實(shí)例講述了PHP實(shí)現(xiàn)的隨機(jī)IP函數(shù).分享給大家供大家參考,具體如下:
PHP編程
function get_rand_ip(){
$arr_1 = array("218","218","66","66","218","218","60","60","202","204","66","66","66","59","61","60","222","221","66","59","60","60","66","218","218","62","63","64","66","66","122","211");
$randarr= mt_rand(0,count($arr_1));
$ip1id = $arr_1[$randarr];
$ip2id= round(rand(600000, 2550000) / 10000);
$ip3id= round(rand(600000, 2550000) / 10000);
$ip4id= round(rand(600000, 2550000) / 10000);
return $ip1id . "." . $ip2id . "." . $ip3id . "." . $ip4id;
}
echo get_rand_ip();//輸出:211.104.85.78
PHP編程更多關(guān)于PHP相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《PHP網(wǎng)絡(luò)編程技巧總結(jié)》、《php curl用法總結(jié)》、《php socket用法總結(jié)》、《php正則表達(dá)式用法總結(jié)》、《php字符串(string)用法總結(jié)》、《PHP數(shù)組(Array)操作技巧大全》、《PHP數(shù)學(xué)運(yùn)算技巧總結(jié)》、《php面向?qū)ο蟪绦蛟O(shè)計(jì)入門教程》、《PHP數(shù)據(jù)結(jié)構(gòu)與算法教程》、《php程序設(shè)計(jì)算法總結(jié)》及《php常見數(shù)據(jù)庫(kù)操作技巧匯總》
PHP編程希望本文所述對(duì)大家PHP程序設(shè)計(jì)有所幫助.
轉(zhuǎn)載請(qǐng)注明本頁(yè)網(wǎng)址:
http://www.snjht.com/jiaocheng/5120.html