tags:

views:

25

answers:

1

Hey, say you have an array of friends that you've retrieved, how can you pick 1 random friend.

Thanks

+1  A: 

Try:

$array = array_slice(array_shuffle($array_orig), 0, 1);

This will get you one friend at random.

Sarfraz