title: Identify if a "Credit card" or "Debit card" by the card number
body: <p>I can initially do a check to identify if I have a valid Payment Card Number by performing Luhn check algorithm.</p>
  
  <p>But then I need to identify if it is a <em>Credit</em> card or a <em>Debit</em> card to perform the next task accordingly. I understand this depends on the first four characters, but I'm not sure about the exact ranges. </p>
  
  <p>If someone can explain or provide with a link which explains this would be great. Thanks.</p>
  
  <p><strong>Edits...</strong></p>
  
  <p>In both these stackoverflow Links I don't see my question is answered. Therefore this can not be a duplicate for any of these.</p>
  
  <p>In my case it doen't read the card using a card reader and instead using the card number, CVV and exp date to get the payment done(User insert these things).</p>
  
  <p>Also "yes" I can do a check to identify if it is a Visa card, Master Card or an American Express card. But no way to find if its a <code>Credit</code> or a <code>Debit</code> card.(For example if the card is a <strong>Visa</strong> card then how will I get to know that <strong>Visa</strong> card is a "credit card" or a "debit card". That's the exact question).</p>