IPAddress
class IPAddress (View source)
Constants
| FORMAT_HEX | 
                     
  | 
            
| FORMAT_IP_STRING | 
                     
  | 
            
Properties
| protected | $ipHex | 
Methods
Builds the IPAddress object from the ip address string provided, or from a hexadecimal string If no ip address is provided, it can be set later by running the setIp function.
Sets the current IP Address.
Returns the IPAddress string, null if no ip address has been set.
No description
Fallback function for those using < PHP 5.4 Decodes a hexadecimally encoded binary string.
Used to check of the current IP is a loopback IP address.
Returns true if the IP address belongs to a private network, false if it is not.
Returns true if the IP is a Link-local address, false if it is not.
No description
No description
Details
        
                            
    __construct(string|null $ipAddress = null, bool $isHex = false)
        
    
    Builds the IPAddress object from the ip address string provided, or from a hexadecimal string If no ip address is provided, it can be set later by running the setIp function.
        
                            $this
    setIp(string $ipAddress, bool $isHex = false)
        
    
    Sets the current IP Address.
        
                            string|null
    getIp(int $format = self::FORMAT_HEX)
        
    
    Returns the IPAddress string, null if no ip address has been set.
        
                    protected        bool
    isIpSet()
        
    
    No description
        
                            string
    hex2bin(string $hex)
        
    
    Fallback function for those using < PHP 5.4 Decodes a hexadecimally encoded binary string.
        
                            bool
    isLoopBack()
        
    
    Used to check of the current IP is a loopback IP address.
        
                            bool
    isPrivate()
        
    
    Returns true if the IP address belongs to a private network, false if it is not.
        
                            bool
    isLinkLocal()
        
    
    Returns true if the IP is a Link-local address, false if it is not.
        
                            
    isIPv4()
        
    
    No description
        
                            
    isIPv6()
        
    
    No description