formata_numdoc

The WooCommerce Boleto formata numdoc function.

Description

formata_numdoc( $num, $tamanho ); 

Parameters (2)

0. $num
The num.
1. $tamanho
The tamanho.

Usage

  1. if ( !function_exists( 'formata_numdoc' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-boleto/includes/banks/bancoob/functions.php'; 
  3.  
  4. // The num. 
  5. $num = null; 
  6.  
  7. // The tamanho. 
  8. $tamanho = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = formata_numdoc($num, $tamanho); 
  12.  

Defined (1)

The function is defined in the following location(s).

/includes/banks/bancoob/functions.php  
  1. function formata_numdoc( $num, $tamanho ) { 
  2. while( strlen($num) < $tamanho) { 
  3. $num="0".$num; 
  4. return $num;