Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Random user agent generator written in PHP.

branch: master

This branch is 0 commits ahead and 0 commits behind master

Octocat-spinner-32 fix incorrect link July 18, 2012
Octocat-spinner-32 composer.json update composer.json February 19, 2014
Octocat-spinner-32 test.php near complete refactoring July 17, 2012
Octocat-spinner-32 uagent.php convert mktime() to time() to avoid notices August 20, 2012

PHP Random User Agent generator

A random User-Agent generator written in PHP. It generates desktop browser User Agent strings, roughly based on browser and OS usage statistics from Wikipedia and as of July 2012.

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 random_uagent(). You may optionally pass a single parameter consisting of an array of language codes to randomly choose from.



"THE BEER-WARE LICENSE" (Revision 42): 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

Something went wrong with that request. Please try again.