This method only checks for the format. It doesn't validate that the value is the one on the card.
CVV is also known as
CVV2 Card Validation Value 2 (Visa)
CVC Card Validation Code (MasterCard)
CID Card Identification (American Express and Discover)
CIN Card Identification Number
CSC Card Security Code
Important information regarding CVV: If you happen to have to store credit card information, you must NOT retain the CVV after transaction is complete. Usually this means you cannot store it in a database, not even in an encrypted form.
This method returns FALSE for card types that don't support CVV.
Return: TRUE if format is correct, FALSE otherwise
If a type is passed, the card will be checked against it. This method only checks the number locally. No banks or payment gateways are involved. This method doesn't guarantee that the card is legitimate. It merely checks the card number passes a mathematical algorithm.
This method only checks for the type marker. It doesn't validate the card number. Some card "brands" share the same numbering system, so checking the card type against any of the sister brand will return the same result.
For instance, if a $card is a MasterCard, type($card, 'EuroCard') will also return true.