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: 
Use [array\_rand](http://php.net/manual/en/function.array-rand.php).
PHP's [array\_rand()](http://php.net/manual/en/function.array-rand.php) for sure. Example:

```
<?php

$names = array('Neo', 'Morpheus', 'Trinity', 'Cypher', 'Tank');
echo 'Hello ' . $names[array_rand($names)];

```