You are here

function _brazilianids_format_cpf in Brazilian IDs 6

Format the CPF number

Parameters

&$cpf: Number, the CPF number

Return value

String, the new CPF

3 calls to _brazilianids_format_cpf()
brazilianids_field in ./brazilianids_cck.inc
Implementation of hook_field().
brazilianids_user in ./brazilianids.module
Implementation of hook_user().
_brazilianids_format_cpfcnpj in ./brazilianids.check.inc
Format the CPF number

File

./brazilianids.check.inc, line 32
brazilianids.check.inc

Code

function _brazilianids_format_cpf($cpf) {
  $cpf = _brazilianids_clean_cpfcnpj($cpf);
  return drupal_substr($cpf, 0, 3) . '.' . drupal_substr($cpf, 3, 3) . '.' . drupal_substr($cpf, 6, 3) . '-' . drupal_substr($cpf, 9, 3);
}