当前位置:Gxlcms > PHP教程 > php读取纯真ip数据库的例子_PHP教程

php读取纯真ip数据库的例子_PHP教程

时间:2021-07-01 10:21:17 帮助过:2人阅读

代码:


 ; 
 ; 
 ; 
 ; 
->fh = ('qqwry.dat', 'rb'); 
->first = ->->last = ->->total = (->last - ->first) / 7; 

 checkIp( = ('.',(() !=4  (=0;  < 4; ++ ([] <'0' || [] > '255' 
 
 = ('Vlong', (->fh, 4 ['long'
 = ('Vlong', (->fh, 3).(0 ['long'
 getInfo( = "" = (->fh, 1 (() != 0) { 
 .=  = (->fh, 1 
 = (->fh, 1); 
 (( 0:  = ''; ; 
 1: 
(->fh, -> = ->getInfo();  2: 
(->fh, -> = ->getInfo(); :  = ->getInfo(); ; 
  ip2addr((! -> checkIp(  = ('N', ((
 = 0 = ->( <=  = (( + ) / 2); 
(->fh, ->first +  * 7 = ((->fh, 4)); 
(->fh, -> = ((->fh, 4)); 
 ( < ) { 
 =  - 1 ( > ) { 
 =  + 1 { 
 = ->first +  * 7
(->fh, ['beginip'] = (->getLong4()); 
 = ->(->fh, ['endip'] = (->getLong4()); 
 = (->fh, 1); 
 (( 1: 
 = ->getLong3(); 
(->fh,  = (->fh, 1); 
 (( 2: 
(->fh, ->['country'] = ->(->fh,  + 4['area'] = ->: 
['country'] = ->getInfo(['area'] = -> 2: 
(->fh, ->['country'] = ->(->fh,  + 8['area'] = ->: 
['country'] = ->getInfo(['area'] = ->
 (   => [] = ('CZ88.NET','',('gb2312', 'utf-8',  
(-> =  =  -> ip2addr('IP地址'(?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/750882.htmlTechArticle代码: ? ; ; ; ; -fh = ('qqwry.dat', 'rb'); -first = - -last = - -total = ( -last - -first) / 7; checkIp( = ('.', ( ( ) !=4 ( =0; 4; ++ ( [ ] '0' || [ ] '255' = ('Vlong', ( -fh,...

人气教程排行