Skip to content

Instantly share code, notes, and snippets.

View armandinhox's full-sized avatar
🎯
Focusing

Armandinho armandinhox

🎯
Focusing
View GitHub Profile
@rafael-neri
rafael-neri / validar_cpf.php
Last active March 6, 2025 11:02
Validar CPF em PHP (Completo)
<?php
function validaCPF($cpf) {
// Extrai somente os números
$cpf = preg_replace( '/[^0-9]/is', '', $cpf );
// Verifica se foi informado todos os digitos corretamente
if (strlen($cpf) != 11) {
return false;