No details $ configarray (sohu10, sina30, qq20, baidu20,); echorandomBaseTimestamp ($ config); functionrandomBaseTimestamp ($ dataarray () {uasort ($ data, function ($, $ B) {returnrand (-1, 1) ;}; $ timetime (); $
No details $ config = array ('sohu '= 10, 'sina' = 30, 'qq' = 20, 'baidu' = 20 ,); echo randomBaseTimestamp ($ config); function randomBaseTimestamp ($ data = array () {uasort ($ data, function ($ a, $ B) {return rand (-1, 1) ;}); $ time = time (); $
<无详细内容>
$config = array( 'sohu' => 10, 'sina' => 30, 'qq' => 20, 'baidu' => 20,);echo randomBaseTimestamp($config);function randomBaseTimestamp($data = array()) { uasort($data, function ($a, $b) { return rand(-1, 1); }); $time = time(); $total = array_sum($data); $mod = $time%$total; $result = ''; foreach($data as $k => $v) { $result = $k; $mod -= $v; if($mod<=0) { break; } } return $result;}