Category: >> PHP Code >> Add dashes to credit card numbers Bookmark and Share

<< lastnext >>

Snippet Name: Add dashes to credit card numbers

Description: Easily add dashes to credit card numbers.

Comment: (none)

Author: CoderZone
Language: PHP
Highlight Mode: PHP
Last Modified: March 01st, 2009

<? php
function AddDash($CC_Num,$CC_Type){ 
if ($CC_Type="VISA") { 
for ($i=0 ; $i < 4 ; $i++) 
$NewCC=$NewCC.substr($CC_Num, ($i*4), 4)."-"; 
return ($NewCC); 
// Example : 
There haven't been any comments added for this snippet yet. You may add one if you like.  Add a comment 
© | users online: 4