Tuesday, March 29, 2005

Coldfusion and Credit Card Numbers...

Question: I would like to display only a portion of a credit card number (last 4 digits, preceded by Xs) on a receipt.

Answer:
<cfset CC = "1234123412344321">
<cfoutput>#CC#</cfoutput><br/>
<cfoutput>#repeatstring("X",len(CC)-4)##mid(CC,len(CC)-3,4)#</cfoutput>

0 Comments:

Post a Comment

<< Home