/** * Return integers values in format 999.999.999-99 * @param string $cpf * @return string */ public static function CPF($cpf) { $cpf = Regex::OnlyInteger($cpf); $cpf = substr($cpf, 0, 3) . '.' . substr($cpf, 3, 3) . '.' . substr($cpf, 6, 3) . '-' . substr($cpf, 9, 2); return $cpf; }