You are here

function _brazilianids_clean_cpfcnpj in Brazilian IDs 6

Clean the string removing all characters except the digits

Parameters

$cpfcnpj: Original "dirty" cpfcnpf

Return value

Returns the clean cpfcnpj

6 calls to _brazilianids_clean_cpfcnpj()
_brazilianids_format_cnpj in ./brazilianids.check.inc
Format the CNPJ number
_brazilianids_format_cpf in ./brazilianids.check.inc
Format the CPF number
_brazilianids_format_cpfcnpj in ./brazilianids.check.inc
Format the CPF number
_brazilianids_is_cpf_cnpj in ./brazilianids.check.inc
Return 'CPF' or 'CNPJ' depend of the type of param
_brazilianids_validate_cnpj in ./brazilianids.check.inc
Check if the provided CNPJ is valid

... See full list

File

./brazilianids.check.inc, line 215
brazilianids.check.inc

Code

function _brazilianids_clean_cpfcnpj($cpfcnpj) {
  return preg_replace('/[^0-9]/', '', $cpfcnpj);
}