Generate User-Agent strings, roughly based on browser and OS usage statistics.
Numbers for more minor variable components of the User-Agent for each browser are chosen randomly, so it may at times generate User-Agents that never actually exist in the wild.
Simply require uagent.php
and call the function UAgent::random()
. You may
optionally pass a single parameter consisting of an array of language codes to
randomly choose from.
- Chrome
- Firefox: Gecko User Agent String Reference
- Internet Explorer: Understanding User-Agent Strings
- Safari
- Opera: Opera User Agent Strings: Opera 15 and Beyond
Generated User-Agent strings are based on formats of valid User-Agents found in the wild but minor variable components such as version numbers aren't always REAL(TM), but they should be well-formed and therefore look realistic.
- Luka Pusic: lukapusic/random-uagent
- Michael White: mwhite/random-uagent
- Web Browsers (Wikipedia)
- Operating Systems (Wikipedia)
- Operating Systems Market Share (StatOWL)
"THE BEER-WARE LICENSE" (Revision 42):
[email protected] wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. Luka Pusic