giggsey / libphonenumber-for-php

PHP version of Google's phone number handling library

Home Page:https://giggsey.com/libphonenumber/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with trimming zeros

murat11 opened this issue · comments

Many phone numbers have leading zeros after the country code. Ivory Coast for example https://www.wikiwand.com/en/Telephone_numbers_in_Ivory_Coast

But this code removes it from resulting number

$normalizedNationalNumber = ltrim($normalizedNationalNumber, '0');

As I can see it does not work. Maybe that util instance must be configured in some special way
image

Doesn't that debug show it working?

The $phoneNumber object has italianLeadingZero set to true, and the numberOfItalianZeros is set to 1.