private function _user_agent()
{
// browser version: 9 or 10
$version = rand(9, 10);
// windows version; here are the meanings:
// Windows NT 6.2 -> Windows 8 // can have IE10
// Windows NT 6.1 -> Windows 7 // can have IE9 or IE10
// Windows NT 6.0 -> Windows Vista // can have IE9
$major_version = 6;
$minor_version = $version == 8 || $version == 9 ? rand(0, 2) : 2;
// add some extra information
$extras = rand(0, 3);
// return the random user agent string
return 'Mozilla/5.0 (compatible; MSIE ' . $version . '.0; Windows NT ' . $major_version . '.' . $minor_version . ($extras == 1 ? '; WOW64' : ($extras == 2 ? '; Win64; IA64' : ($extras == 3 ? '; Win64; x64' : ''))) . ')';
}