- array_shift: documentation ( source)
- shuffle: documentation ( source)
<?php
class gimmeName{
public $array = array('Tisha', 'Vesta', 'Josephine');
public function giveMeUniqueName(){
shuffle($this->array);
return array_shift($this->array);
}
}
$gn = new gimmeName;
echo $gn->giveMeUniqueName() . PHP_EOL;
echo $gn->giveMeUniqueName() . PHP_EOL;
echo $gn->giveMeUniqueName() . PHP_EOL;