O Objetivo é só mostrar a bandeira sem que seja preciso clicar em uma operadora
Eu peguei o código do oscommerce e o codigo aqui do Imasters
if (preg_match('/^4[0-9]{12}([0-9]{3})?$/', $this->cc_number)) { $this->cc_type = 'Visa'; } elseif (preg_match('/^5[1-5][0-9]{14}$/', $this->cc_number)) { $this->cc_type = 'Master Card'; } elseif (preg_match('/^3[47][0-9]{13}$/', $this->cc_number)) { $this->cc_type = 'American Express'; } elseif (preg_match('/^3(0[0-5]|[68][0-9])[0-9]{11}$/', $this->cc_number)) { $this->cc_type = 'Diners Club'; } elseif (preg_match('/^(3841\d{10}(\d{3})?)|(3841\d{15})$/', $this->cc_number)) { $this->cc_type = 'Hipercard'; } elseif (preg_match('/^([6362]{4})([0-9]{12})$/', $this->cc_number)) { $this->cc_type = 'Hipercard';
Mais eu não consigo fazer funcionar o Hipercard e nem o Elo
Pra gerar numeros válidos:
http://www.geradordecartaodecredito.com.br/amex
Agradeço a quem puder ,me ajudar,
marcelo