{"id":15028956,"url":"https://github.com/renderbittechnologies/normalize-phone","last_synced_at":"2026-03-15T19:39:44.574Z","repository":{"id":57047050,"uuid":"172243442","full_name":"RenderbitTechnologies/normalize-phone","owner":"RenderbitTechnologies","description":"Normalize a phone number (with or without country code)","archived":false,"fork":false,"pushed_at":"2023-12-04T10:42:31.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-21T02:46:24.073Z","etag":null,"topics":["phone-format","phone-number","php","php-lib","php-library","php5","php7"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/renderbit/normalize-phone","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RenderbitTechnologies.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-23T17:34:59.000Z","updated_at":"2023-12-04T10:42:22.000Z","dependencies_parsed_at":"2025-01-19T21:44:00.803Z","dependency_job_id":"46ba152c-4418-4cbd-b240-f5b85c5601ad","html_url":"https://github.com/RenderbitTechnologies/normalize-phone","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"d778d43030c7d089e2d650c213ffe40978e2ee62"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RenderbitTechnologies%2Fnormalize-phone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RenderbitTechnologies%2Fnormalize-phone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RenderbitTechnologies%2Fnormalize-phone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RenderbitTechnologies%2Fnormalize-phone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RenderbitTechnologies","download_url":"https://codeload.github.com/RenderbitTechnologies/normalize-phone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243338528,"owners_count":20275525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["phone-format","phone-number","php","php-lib","php-library","php5","php7"],"created_at":"2024-09-24T20:09:25.941Z","updated_at":"2025-12-24T19:11:44.861Z","avatar_url":"https://github.com/RenderbitTechnologies.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# normalize-phone\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Software License][ico-license]](LICENSE.md)\n[![Build Status][ico-travis]][link-travis]\n[![Coverage Status][ico-scrutinizer]][link-scrutinizer]\n[![Quality Score][ico-code-quality]][link-code-quality]\n[![Total Downloads][ico-downloads]][link-downloads]\n\nNormalize a phone number (with or without country code).\n\n## Background\n\nWe needed to send phone numbers to a third-party API as an amalgamation of the phone number and the country code, without the plus sign, brackets or any other special characters such as hyphens or spaces. We built this package as a solution to automatically parse user-input phone numbers and pass them as-is to the API, if already in the correct format - otherwise amend them and send the formatted numbers to the API.\n\nThis package looks for the environment variable `PHONE_DEFAULT_COUNTRY_CODE` to define the base country code to be prepended to the numbers with no country code. If no such variable is define, the package assumes a default of India (`91`).\n\n## Install\n\nVia Composer\n\n``` bash\n$ composer require renderbit/normalize-phone\n```\n\n## Usage\n\n``` php\nnormalize_phone('9434012345');        // '919434012345'\nnormalize_phone('+919434012345');     // '919434012345'\nnormalize_phone('+91-9434012345');    // '919434012345'\nnormalize_phone('+19434012345');      // '19434012345'\nnormalize_phone('+91 9434012345');    // '919434012345'\nnormalize_phone('(+91) 94340 12345'); // '919434012345'\n```\n\n## Change log\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Testing\n\n``` bash\n$ composer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email \u0026ldquo;contact `at` renderbit `dot` com\u0026rdquo; instead of using the issue tracker.\n\n## Credits\n\n- [Renderbit Technologies][link-author]\n- [All Contributors][link-contributors]\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/renderbit/normalize-phone.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-travis]: https://img.shields.io/travis/RenderbitTechnologies/normalize-phone/master.svg?style=flat-square\n[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/RenderbitTechnologies/normalize-phone.svg?style=flat-square\n[ico-code-quality]: https://img.shields.io/scrutinizer/g/RenderbitTechnologies/normalize-phone.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/renderbit/normalize-phone.svg?style=flat-square\n\n[link-packagist]: https://packagist.org/packages/renderbit/normalize-phone\n[link-travis]: https://travis-ci.org/RenderbitTechnologies/normalize-phone\n[link-scrutinizer]: https://scrutinizer-ci.com/g/RenderbitTechnologies/normalize-phone/code-structure\n[link-code-quality]: https://scrutinizer-ci.com/g/RenderbitTechnologies/normalize-phone\n[link-downloads]: https://packagist.org/packages/renderbit/normalize-phone\n[link-author]: https://github.com/RenderbitTechnologies\n[link-contributors]: ../../contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenderbittechnologies%2Fnormalize-phone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenderbittechnologies%2Fnormalize-phone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenderbittechnologies%2Fnormalize-phone/lists"}