|
It is currently Fri May 18, 2012 3:09 am
|
View unanswered posts | View active topics
|
Page 1 of 1
|
[ 5 posts ] |
|
| Author |
Message |
|
Swift Griggs
|
Post subject: Adding dashes to credit card # Posted: 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 |
|
 |
|
Boaz Yahav
|
Post subject: RE: Adding dashes to credit card # Posted: 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 |
|
 |
|
Swift Griggs
|
Post subject: RE: Adding dashes THANX Posted: Mon Jan 25, 1999 12:43 am |
|
|
|
|
Cool, that's exactly what I was looking for!
|
|
| Top |
|
 |
|
Boaz Yahav
|
Post subject: RE: Adding dashes THANX Posted: Mon Jan 25, 1999 12:48 am |
|
|
|
|
No problem...
Thats what the forum is for :)
|
|
| Top |
|
 |
|
¤µ¤§¤¤¤µ
|
Post subject: RE: Adding dashes THANX Posted: Fri Feb 26, 1999 11:57 am |
|
|
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 5 posts ] |
|
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
|
|