domain

The WooCommerce Checkout Manager domain function.

Description

domain( $domainb ); 

Parameters (1)

0. $domainb
The domainb.

Usage

  1. if ( !function_exists( 'domain' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-checkout-manager/includes/pickers/include/ui-1.10.0/ui-lightness/dislawooccm.php'; 
  3.  
  4. // The domainb. 
  5. $domainb = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = domain($domainb); 
  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 domain($domainb)  
  2. {  
  3. $bits = explode('/', $domainb);  
  4. if ($bits[0]=='http:' || $bits[0]=='https:')  
  5. {  
  6. $domainb= $bits[2];  
  7. } else {  
  8. $domainb= $bits[0];  
  9. }  
  10. unset($bits);  
  11. $bits = explode('.', $domainb);  
  12. $idz=count($bits);  
  13. $idz-=3;  
  14. if (strlen($bits[($idz+2)])==2) {  
  15. $url=$bits[$idz].'.'.$bits[($idz+1)].'.'.$bits[($idz+2)];  
  16. } else if (strlen($bits[($idz+2)])==0) {  
  17. $url=$bits[($idz)].'.'.$bits[($idz+1)];  
  18. } else {  
  19. $url=$bits[($idz+1)].'.'.$bits[($idz+2)];  
  20. }  
  21. return $url;  
  22. }