hideCardNumber

The Paid Memberships Pro hideCardNumber function.

Description

hideCardNumber( $c, (constant) $dashes = true ); 

Parameters (2)

0. $c
The c.
1. $dashes — Optional. (constant) => true
The dashes.

Usage

  1. if ( !function_exists( 'hideCardNumber' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/functions.php'; 
  3.  
  4. // The c. 
  5. $c = null; 
  6.  
  7. // The dashes. 
  8. $dashes = true; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = hideCardNumber($c, $dashes); 
  12.  

Defined (1)

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

/includes/functions.php  
  1. function hideCardNumber($c, $dashes = true) 
  2. if($c) 
  3. if($dashes) 
  4. return "XXXX-XXXX-XXXX-" . substr($c, strlen($c) - 4, 4); 
  5. else 
  6. return "XXXXXXXXXXXX" . substr($c, strlen($c) - 4, 4); 
  7. else 
  8. return "";