程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> php讀取純真ip數據庫的例子

php讀取純真ip數據庫的例子

編輯:關於PHP編程

代碼:

<?
 ; 
 ; 
 ; 
 ; 
->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地址'(?>

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved