Something like this seems to work alright:
function random_word(&$words)
{
$r = rand(0,sizeof($words)-1); // Get random index
$word = $words[$r]; // Get current word
array_splice($words,$r,1); // Remove this word from array
return $word; // Return the word
}
// Set up our words array
$words = array("Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado",
"Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho",
"Illinois", "Indiana", "Iowa", "Kansas", "Kentucky");
// Output words while the words array has entries
while(sizeof($words)>0)
{
echo random_word($words) . "<br>";
}