Forum Moderators: coopster
You should even turn up the PHP code already written to do it.
Thirty something years ago the first real program I wrote was to calculate valid check digited numbers (not for credit cards though)
Whether that card number is in existence or has ever been in existence is another story - that is what the merchant account does - contacts the bank (if the mod-10 check is valid) to ensure that the card is in existence, checks CVV and expiry dates, if the card has been stopped and credit limits before returning a result.