File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626 }
2727 ],
2828 "require" : {
29- "php" : " >=5.3.3 "
29+ "php" : " ~5.4|~7.0 "
3030 },
3131 "autoload" : {
3232 "psr-4" : {
Original file line number Diff line number Diff line change 99
1010use itbdw \Ip \IpLocation ;
1111
12- $ hostnames = [
13- 'google.com ' ,
14- 'weibo.com ' ,
15- 'nothing ' ,
12+ $ ips = [
13+ "172.217.25.14 " ,//美国
14+ "140.205.172.5 " ,//杭州
15+ "123.125.115.110 " ,//北京
16+ "221.196.0.0 " ,//
17+ "60.195.153.98 " ,
1618];
17- shuffle ($ hostnames );
18- $ hostname = array_pop ($ hostnames );
1919
20- $ ip = gethostbyname ( $ hostname );
20+ foreach ( $ ips as $ ip ) {
2121
22- echo $ hostname . "\n" ;
22+ echo json_encode (IpLocation:: getLocation ( $ ip ), JSON_UNESCAPED_UNICODE ) . "\n" ;
2323
24- $ qqwry_path = dirname ( __DIR__ ) . ' /src/qqwry.dat ' ;
24+ }
2525
26- echo json_encode (IpLocation::getLocation ($ ip ), JSON_UNESCAPED_UNICODE ) . "\n" ;
27- echo json_encode (IpLocation::getLocation ($ ip , $ qqwry_path ), JSON_UNESCAPED_UNICODE ) . "\n" ;
2826
You can’t perform that action at this time.
0 commit comments