卷曲结果随机挑选1

时间:2014-06-30 19:47:02

标签: php curl random shuffle

我是php的新手,我有这段代码,我需要知道如何从这段代码中只获得1个随机结果。 感谢

Array ( [0] => Hobby Lobby [1] => Zendaya [2] => Iggy Azalea [3] => Costa Rica vs Greece [4] => WWE [5] => The Leftovers [6] => Robin Thicke [7] => France Vs Nigeria [8] => Philip Lutzenkirchen [9] => Jason Kidd ) 

}

function my_get_google_hot_trend($country_code) {
    $result = array(
        'data' => array(),
        'error' => ''
    );


    $keywords = $match[1];

    $result['data'] = $keywords;
    return $result;
}
?> 

请帮助我获得我需要的结果......

1 个答案:

答案 0 :(得分:-1)

没有测试,但这应该有效;

$阵列[兰特(0,9)];