Author: Avtandil Kikabidze (akalongman@gmail.com)
Example #1
0
 /**
  * @test
  */
 public function testRemote()
 {
     $status = Ip::isRemote('8.8.8.8');
     $this->assertTrue($status);
 }
Example #2
0
 /**
  * @test
  */
 public function test9()
 {
     $long = Ip::ip2long('192.168.1.1');
     $this->assertEquals('3232235777', $long);
     $dec = Ip::long2ip('3232235777');
     $this->assertEquals('192.168.1.1', $dec);
     $long = Ip::ip2long('fe80:0:0:0:202:b3ff:fe1e:8329');
     $this->assertEquals('338288524927261089654163772891438416681', $long);
     $dec = Ip::long2ip('338288524927261089654163772891438416681', true);
     $this->assertEquals('fe80::202:b3ff:fe1e:8329', $dec);
 }