Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View sandroneuhaus's full-sized avatar

Sandro José Neuhaus sandroneuhaus

View GitHub Profile
@sandroneuhaus
sandroneuhaus / validar_cpf.php
Created June 14, 2022 16:59 — forked from rafael-neri/validar_cpf.php
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;