function firefox($arch) { $ver = array_random(array('Gecko/' . date('Ymd', rand(strtotime('2011-1-1'), time())) . ' Firefox/' . rand(5, 7) . '.0', 'Gecko/' . date('Ymd', rand(strtotime('2011-1-1'), time())) . ' Firefox/' . rand(5, 7) . '.0.1', 'Gecko/' . date('Ymd', rand(strtotime('2010-1-1'), time())) . ' Firefox/3.6.' . rand(1, 20), 'Gecko/' . date('Ymd', rand(strtotime('2010-1-1'), time())) . ' Firefox/3.8')); switch ($arch) { case 'lin': return "Mozilla/5.0 (X11; Linux i586; rv:" . rand(28, 35) . ".0) {$ver} "; case 'lin2': return "Mozilla/" . rand(4, 5) . "." . rand(1, 8) . " (X11; Linux i686; rv:" . rand(29, 35) . ".0) {$ver} "; case 'mac': $osx = osx_version(); return "Mozilla/5.0 (Macintosh; Intel Mac OS X {$osx}) {$ver} Safari/" . rand(600, 740) . "A" . rand(112, 199) . "A"; } }
function chrome($arch) { $saf = rand(531, 536) . rand(0, 2); $chrome = chrome_version(); switch ($arch) { case 'lin': return "(X11; Linux {proc}) AppleWebKit/{$saf} (KHTML, like Gecko) Chrome/{$chrome} Safari/{$saf}"; case 'mac': $osx = osx_version(); return "(Macintosh; U; {proc} Mac OS X {$osx}) AppleWebKit/{$saf} (KHTML, like Gecko) Chrome/{$chrome} Safari/{$saf}"; case 'win': default: $nt = nt_version(); return "(Windows NT {$nt}) AppleWebKit/{$saf} (KHTML, like Gecko) Chrome/{$chrome} Safari/{$saf}"; } }