Register now or log in to join your professional community.
Please share you best thoughts as a best suggestion. Many thanks in advance. :)
There is some confusion in your question and I can feel two different aspects of your question:
First Part:
If you are concerned with for first part, you can look for Asif's answer.
Second Part:
If you are concerned for2nd part, then I don't think so that you can find any such service by which you check validity and availability of a credit card. This part is taken care by payment gateways when you put your credit card for payment.
You need to write a script that checks the entered card number against the Luhn algorithm.
Generally, though, this is frivolous check. Just because the pattern is correct does not mean the card number is valid.
Whilst not perfect, the following will help you get started: http://adrianotto.com/2011/10/better-luhn-formula-validator-for-php/
If you have the pattern of the text or number, the best solution is to use regular expressions. If you don't know how to write them, you will find tons of them over the web for many purposes and patterns.