This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static function urlAmigavel($nom_tag,$slug="-") { | |
$string = strtolower($nom_tag); | |
// Código ASCII das vogais | |
$ascii['a'] = range(224, 230); | |
$ascii['e'] = range(232, 235); | |
$ascii['i'] = range(236, 239); | |
$ascii['o'] = array_merge(range(242, 246), array(240, 248)); | |
$ascii['u'] = range(249, 252); | |