gglcptch_recaptcha_mailhide_email_parts

Gets the parts of the email to expose to the user.

Description

gglcptch_recaptcha_mailhide_email_parts( $email ); 

eg, given johndoe@example,com return ["john", example.com]. the email is then displayed as john...@example.com

Parameters (1)

0. $email
The email.

Usage

  1. if ( !function_exists( 'gglcptch_recaptcha_mailhide_email_parts' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-captcha-recaptcha-by-bestwebsoft/lib/recaptchalib.php'; 
  3.  
  4. // The email. 
  5. $email = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = gglcptch_recaptcha_mailhide_email_parts($email); 
  9.  

Defined (1)

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

/lib/recaptchalib.php  
  1. function gglcptch_recaptcha_mailhide_email_parts ($email) { 
  2. $arr = preg_split("/@/", $email ); 
  3.  
  4. if (strlen ($arr[0]) <= 4) { 
  5. $arr[0] = substr ($arr[0], 0, 1); 
  6. } else if (strlen ($arr[0]) <= 6) { 
  7. $arr[0] = substr ($arr[0], 0, 3); 
  8. } else { 
  9. $arr[0] = substr ($arr[0], 0, 4); 
  10. return $arr;