ISN (services de réseaux sociaux internationaux - applications interactives et sites web dynamiques)
Adding dashes to credit card numbers - PHP Scripts
<?
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);
}
// Example :
$new_cc_num=AddDash("4580458045804580","VISA");
echo"$new_cc_num";
?>
|