getNumberOfLeadingZeros() public method

Returns the number of leading zeros of this phone number.
public getNumberOfLeadingZeros ( ) : integer
return integer The number of leading zeros.
 /**
  * Gets the national significant number of the a phone number. Note a national significant number
  * doesn't contain a national prefix or any formatting.
  *
  * @param \libphonenumber\PhoneNumber $number the phone number for which the national significant number is needed
  * @return string  the national significant number of the PhoneNumber object passed in
  */
 public function getNationalSignificantNumber(PhoneNumber $number)
 {
     // If leading zero(s) have been set, we prefix this now. Note this is not a national prefix.
     $nationalNumber = '';
     if ($number->isItalianLeadingZero()) {
         $zeros = str_repeat('0', $number->getNumberOfLeadingZeros());
         $nationalNumber .= $zeros;
     }
     $nationalNumber .= $number->getNationalNumber();
     return $nationalNumber;
 }