{"id":16673088,"url":"https://github.com/ph-7/phonedetector","last_synced_at":"2025-04-09T20:06:20.057Z","repository":{"id":57038422,"uuid":"197463778","full_name":"pH-7/PhoneDetector","owner":"pH-7","description":"📱 Detect the user mobile phone (Android or iOS) based on their device's OS","archived":false,"fork":false,"pushed_at":"2022-11-25T11:04:32.000Z","size":28,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T20:06:13.962Z","etag":null,"topics":["android-detector","app-store","detect-phone","detector","device-detection","device-detector","device-detector-php","ios-detector","lightweight-library","mobile","phone","phone-detection","phone-detector","phone-os-detector","php","redirect-mobile"],"latest_commit_sha":null,"homepage":"https://github.com/pH-7/PhoneDetector","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/pH-7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-17T21:13:03.000Z","updated_at":"2024-11-16T04:30:19.000Z","dependencies_parsed_at":"2022-08-24T00:51:14.873Z","dependency_job_id":null,"html_url":"https://github.com/pH-7/PhoneDetector","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pH-7%2FPhoneDetector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pH-7%2FPhoneDetector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pH-7%2FPhoneDetector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pH-7%2FPhoneDetector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pH-7","download_url":"https://codeload.github.com/pH-7/PhoneDetector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"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":["android-detector","app-store","detect-phone","detector","device-detection","device-detector","device-detector-php","ios-detector","lightweight-library","mobile","phone","phone-detection","phone-detector","phone-os-detector","php","redirect-mobile"],"created_at":"2024-10-12T12:24:33.043Z","updated_at":"2025-04-09T20:06:20.034Z","avatar_url":"https://github.com/pH-7.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📱 PhoneDetector\n\n**Lightweight PHP 7.2 library that detects users' mobile phone based on the device OS.**\n\n\n## 📓 Installation (with Composer)\n\n```bash\ncomposer require ph-7/phonedetector\n```\n\n\n## 🎮  Usage\n\nBelow are two simple examples of what you can do with **PhoneDetector** library.\n\n### Example 1\n\n```php\nuse PierreHenry\\PhoneDetector\\PhoneDetector;\n\n$phoneDetector = new PhoneDetector();\nif ($phoneDetector-\u003eisAndroid()) {\n    echo 'Your mobile phone is Android!';\n}\n\nif ($phoneDetector-\u003eisIos()) {\n    echo 'Your mobile phone runs on iOS';\n}\n```\n\n### Example 2\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php'; // Include Composer to load the library\n\nuse PierreHenry\\PhoneDetector\\PhoneDetector;\n\n$phoneDetector = new PhoneDetector();\n\nif ($phoneDetector-\u003eisAndroid()) {\n    $url = 'https://play.google.com/store/apps/details?id=com.lifyzer';\n} elseif($phoneDetector-\u003eisIos()) {\n    $url = 'https://apps.apple.com/app/longer-life-lifyzer-food-scan/id1466196809';\n} else {\n    $url = 'https://DEFAULT-URL.example';\n}\n\nheader('Location: ' . $url);\n```\n\n\n## ⚙ Server Requirement\n\n- [PHP 7.2](https://php.net/releases/7_2_0.php) or higher.\n\n\n## 🚀 Author\n\n[![Pierre-Henry Soria](https://avatars0.githubusercontent.com/u/1325411?s=200)](https://pierrehenry.be \"My personal website :-)\")\n\n[![@phenrysay][twitter-image]][twitter-url]\n\n**[Pierre-Henry Soria][author-url]**, a Passionate, Zen\u0026Cool Belgian Software Engineer :belgium: :chocolate_bar:\n\n\n## 😄 Used By...\n\nI initially created PhoneDetector to redirect users to the correct app's store for *https://get.lifyzer.com* depending on the mobile device.\n\n**[https://github.com/Lifyzer/get.lifyzer.com](https://github.com/Lifyzer/get.lifyzer.com)**\n\n\n## ⚖ License\n\n**PhoneDetector** library is generously distributed under [MIT License][license-url].\n\n\n\u003c!-- GitHub's Markdown reference links --\u003e\n[author-url]: https://pierrehenry.be\n[license-url]: https://opensource.org/licenses/MIT\n[twitter-image]: https://img.shields.io/twitter/url/https/shields.io.svg?style=social\n[twitter-url]: https://twitter.com/phenrysay\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fph-7%2Fphonedetector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fph-7%2Fphonedetector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fph-7%2Fphonedetector/lists"}