esip

The WooCommerce Checkout Manager esip function.

Description

esip( $ip_addr ); 

Parameters (1)

0. $ip_addr
The ip addr.

Usage

  1. if ( !function_exists( 'esip' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-checkout-manager/includes/pickers/include/ui-1.10.0/ui-lightness/dislawooccm.php'; 
  3.  
  4. // The ip addr. 
  5. $ip_addr = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = esip($ip_addr); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/pickers/include/ui-1.10.0/ui-lightness/dislawooccm.php  
  1. function esip($ip_addr)  
  2. {  
  3. //first of all the format of the ip address is matched  
  4. if(preg_match("/^(\d{1, 3})\.(\d{1, 3})\.(\d{1, 3})\.(\d{1, 3})$/", $ip_addr))  
  5. {  
  6. //now all the intger values are separated  
  7. $parts=explode(".", $ip_addr);  
  8. //now we need to check each part can range from 0-255  
  9. foreach($parts as $ip_parts)  
  10. {  
  11. if(intval($ip_parts)>255 || intval($ip_parts)<0)  
  12. return FALSE; //if number is not within range of 0-255  
  13. }  
  14. return TRUE;  
  15. }  
  16. else  
  17. return FALSE; //if format of ip address doesn't matches  
  18. }