It is currently Tue Feb 07, 2012 8:41 am

All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Adding dashes to credit card #
PostPosted: Sun Jan 24, 1999 9:58 pm 
The bank we use to validate our credit cards wants us to provide a paper format to validate the cards. This paper format must have credit card numbers separated by "-" every 4 digits. How can I do this? Seems like I'd need AWK or something.


Top
  
 
 Post subject: RE: Adding dashes to credit card #
PostPosted: Sun Jan 24, 1999 11:10 pm 
You can use the next function. It's good for VISA cards but you can easily add cases for any other card :

<?
function AddDash($CC_Num,$CC_Type){
if ($CC_Type="VISA") {
$NewCC="";
for ($i=0 ; $i < 4 ; $i++)
$NewCC=$NewCC.substr($CC_Num, ($i*4), 4)."-";
}
$NewCC=substr($NewCC,0,19);
return ($NewCC);
}
?>


Top
  
 
 Post subject: RE: Adding dashes THANX
PostPosted: Mon Jan 25, 1999 12:43 am 
Cool, that's exactly what I was looking for!


Top
  
 
 Post subject: RE: Adding dashes THANX
PostPosted: Mon Jan 25, 1999 12:48 am 
No problem...

Thats what the forum is for :)


Top
  
 
 Post subject: RE: Adding dashes THANX
PostPosted: Fri Feb 26, 1999 11:57 am 
¤¤¤§¤µ¤¤¤§¤µ


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 2 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to: