{"id":36993051,"url":"https://github.com/choval/email_parse","last_synced_at":"2026-01-13T23:45:13.833Z","repository":{"id":56952245,"uuid":"229481298","full_name":"choval/email_parse","owner":"choval","description":"Email parse and validation functions for PHP","archived":false,"fork":false,"pushed_at":"2023-11-19T21:18:54.000Z","size":61,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-18T14:57:07.471Z","etag":null,"topics":["email","email-parser","email-validation","parse","php","punycode","unicode","validate"],"latest_commit_sha":null,"homepage":null,"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/choval.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-21T20:47:00.000Z","updated_at":"2023-09-01T03:12:37.000Z","dependencies_parsed_at":"2022-08-21T03:40:22.224Z","dependency_job_id":null,"html_url":"https://github.com/choval/email_parse","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/choval/email_parse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/choval%2Femail_parse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/choval%2Femail_parse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/choval%2Femail_parse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/choval%2Femail_parse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/choval","download_url":"https://codeload.github.com/choval/email_parse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/choval%2Femail_parse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["email","email-parser","email-validation","parse","php","punycode","unicode","validate"],"created_at":"2026-01-13T23:45:13.761Z","updated_at":"2026-01-13T23:45:13.828Z","avatar_url":"https://github.com/choval.png","language":"PHP","readme":"# choval/email\\_parse\n\nEmail functions for validating and parsing emails.\n\n## Why\n\n1. PHP's `filter_var` doesn't validate Unicode emails.\n2. Punycode~\n3. Why not?\n\n## Install\n\n```sh\ncomposer require choval/email_parse\n```\n\n## Functions\n\n### email\\_parse\n\nParses an email and returns an array with the parts of an email.\n\n```php\n$parts = email_parse('user@EXAMPLE.COM');\nvar_dump($parts);\n/*\narray(11) {\n  [\"raw\"]=\u003e\n  string(16) \"user@EXAMPLE.COM\"\n  [\"unicode\"]=\u003e\n  bool(false)\n  [\"valid\"]=\u003e\n  bool(true)\n  [\"idn_domain\"]=\u003e\n  string(11) \"example.com\"\n  [\"idn_local\"]=\u003e\n  string(4) \"user\"\n  [\"idn_tld\"]=\u003e\n  string(3) \"com\"\n  [\"domain\"]=\u003e\n  string(11) \"example.com\"\n  [\"tld\"]=\u003e\n  string(3) \"com\"\n  [\"local\"]=\u003e\n  string(4) \"user\"\n  [\"safe_email\"]=\u003e\n  string(16) \"user@example.com\"\n  [\"email\"]=\u003e\n  string(16) \"user@example.com\"\n}\n*/\n\n// Go crazy\n$parts = email_parse('😃@테스트。テスト');\nvar_dump($parts);\n/*\narray(11) {\n  [\"raw\"]=\u003e\n  string(26) \"😃@테스트。テスト\"\n  [\"unicode\"]=\u003e\n  bool(true)\n  [\"valid\"]=\u003e\n  bool(true)\n  [\"idn_domain\"]=\u003e\n  string(25) \"xn--9t4b11yi5a.xn--zckzah\"\n  [\"idn_local\"]=\u003e\n  string(8) \"xn--h28h\"\n  [\"idn_tld\"]=\u003e\n  string(10) \"xn--zckzah\"\n  [\"domain\"]=\u003e\n  string(19) \"테스트.テスト\"\n  [\"tld\"]=\u003e\n  string(9) \"テスト\"\n  [\"local\"]=\u003e\n  string(4) \"😃\"\n  [\"safe_email\"]=\u003e\n  string(34) \"xn--h28h@xn--9t4b11yi5a.xn--zckzah\"\n  [\"email\"]=\u003e\n  string(24) \"😃@테스트.テスト\"\n}\n*/\n```\n\n### email\\_valid\n\nCheck if an email is valid and returns the email if valid or false.  \nUses `email_parse` in the background and returns `email` key.\n\n```php\n$valid = email_valid('😃@테스트。テスト');\nvar_dump($valid);\n// string(24) \"😃@테스트.テスト\"\n\n// Non valid because of starting dot\n$valid = email_valid('.😃@테스트.テスト');\nvar_dump($valid);\n// bool(false)\n```\n\n### email\\_safe\n\nCheck if an email is valid and returns the email in punycode if valid or false.  \nUses `email_parse` in the background and returns `safe_email` key.\n\n```php\n$valid = email_safe('😃@테스트。テスト');\nvar_dump($valid);\n// string(34) \"xn--h28h@xn--9t4b11yi5a.xn--zckzah\"\n\n// Non valid because of starting dot\n$valid = email_safe('.😃@테스트.テスト');\nvar_dump($valid);\n// bool(false)\n```\n\n## License\n\nMIT\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchoval%2Femail_parse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchoval%2Femail_parse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchoval%2Femail_parse/lists"}