I have this useragents' array
$userAgents = array ('Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1', //FF4
'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120427 Firefox/15.0a1', //F15
'Opera/9.80 (Macintosh; Intel Mac OS X; U; en) Presto/2.2.15 Version/10.00', //O10
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.55.3 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10', //S5
'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.1)', //IE7
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1)' //IE8
'Mozilla/5.0 (MSIE 9.0; Windows NT 6.1; Trident/5.0)' //IE9
);
I wanted to get randomly a different user agent, so I used :
$userAgent = $userAgents[array_rand($userAgents)];
How can I do the same random selection but give more weight to, let's say, the 3 first array entries... ?