brick / phonenumber Goto Github PK
View Code? Open in Web Editor NEWA phone number library for PHP
License: MIT License
A phone number library for PHP
License: MIT License
Can you tag this library, please?
Hi, I have a question,
What's the main difference between this lib: https://github.com/giggsey/libphonenumber-for-php and yours?
Regards,
Hi,
I'm having trouble catching the exceptions using the following code.
try {
$numberParsed = PhoneNumber::parse('+333', $region);
$numberValid = PhoneNumber::parse('+333', $region)->isValidNumber();
}catch (PhoneNumberParseException $e) {
// 'The string supplied is too short to be a phone number.'
error_log($e);
}
Throws the error
PHP Fatal error: Uncaught libphonenumber\NumberParseException: The string supplied is too short to be a phone number. in /www/zendsvr6/htdocs/ridgwad/stream_dev_1/core/utils/composer/vendor/giggsey/libphonenumber-for-php/src/PhoneNumberUtil.php:1650
Stack trace:
#0 /www/zendsvr6/htdocs/ridgwad/stream_dev_1/core/utils/composer/vendor/giggsey/libphonenumber-for-php/src/PhoneNumberUtil.php(3023): libphonenumber\PhoneNumberUtil->parseHelper('+333', 'GB', false, true, Object(libphonenumber\PhoneNumber))
Any ideas what I'm doing wrong?
Hello,
Just wanted to warn you there is a syntax error on line 106 in the file.
A "?" symbol is making all crash.
Btw thanks for the plugin !
Cheers,
Thomas
Hi
I would like to use brick phoneumber, but it's missing geolocation features.
Are there any plans to add this in future releases?
Thanks
Hello!
When trying to parse phone numbers of the format 599 XXXX XXXX
with country code AN
, parse()
raises a PhoneNumberParseException
with the message Missing or invalid default region.
.
e.g.
try {
$number = PhoneNumber::parse('59912345678', 'AN');
echo $number->format(PhoneNumberFormat::E164);
} catch (PhoneNumberParseException $e) {
echo $e->getMessage();
}
Netherlands Antilles was dissolved in 2010 - is this why phone numbers from this country are not supported by parse()
?
The Netherlands Antilles Alpha-2 code was 'AN', and the Alpha-2 codes of most other countries seem to work with parse()
.
The country calling code of Netherlands Antilles was 599
, and it is now in use in Curaçao and the Caribbean Netherlands.
My company has a lot of legacy customers whose phone numbers begin with 599
and whose country codes are AN
. It would really help us out if AN
was supported by parse()
.
Thanks for your time and maintaining this package 😄
many thanks, that helps
what i was after if you
$phoneNumber = PhoneNumber::parse('02079460585');
echo $phoneNumber->getGeographicalAreaCode(); // 20
echo $phoneNumber->getGeographicalAreaCodeLocation(); // London
$phoneNumber = PhoneNumber::parse('01993123452');
echo $phoneNumber->getGeographicalAreaCode(); // 01993
echo $phoneNumber->getGeographicalAreaCodeLocation(); // Witney
$phoneNumber = PhoneNumber::parse('0901254265');
echo $phoneNumber->getGeographicalAreaCode(); // 09
echo $phoneNumber->getGeographicalAreaCodeLocation(); // NGN
echo $phoneNumber->getNumberType(); // premium rate
basically trying to phase everything from
https://www.ofcom.org.uk/phones-telecoms-and-internet/advice-for-consumers/advice/telephone-area-codes-tool
many thanks
This is what I'm looking for, I have large swats of random text (user messages) and I want to detect if any of them contain valid phone numbers.. the numbers come an assortment of formats and countries
Hi great bit of software, do you think you could build in UK dialing codes in to the parser?
thanks
Hi
Can we have PhoneNumberToCarrierMapper so we can get the operator name when available?
https://giggsey.github.io/libphonenumber-for-php/docs/PhoneNumberToCarrierMapper.html
Thanks!
getRegionCode, mentioned on the main page, is not defined in libphonenumber\PhoneNumber
Array
(
[error] => No valid contact for +5575*******
)
I got this error when I tried searching this number. On some online searched I found that it's from Brazil but it's giving error here.
Hi guys
There is a particularly problematic bug in the parse functionality.
The function remove the zero numbers from the prefix.
Eg: 00391234567 --> 391234567
This is not a good behavior because in some countries the zero numbers in prefix are integral part of the phone number.
There is a way to fix this?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.