Question: What is the best way of doing this ?

```
rand('Helloworld','Hi world');

```

I know this is not working as rand needs a min and max number, but what is the solution for this ?

Answer: 
Something likes that:

```
<?php
$array = array(1, 2, 3);
$array[ mt_rand( 0, count($array) -1 ) ];
?>

```
```
function rand_of() {
    $_ = func_get_args();
    return $_[rand(0, count($_) - 1)];
}

echo rand_of("foo", "bar", "baz");

```