The easiest solution would be to keep track of questions you have already asked e.g.
$questions = array(
1,
2,
3,
4,
5
);
$asked_questions = array(
2,
5
);
The questions array is just all the questions to ask, the asked_questions array is keys or even the questions themselves stored. Once you ask a question you store it so it can be checked when finding a new random question to display.
A very simplistic example of what Im talking about.
function randomQuestion()
{
$index = rand(1,5);
if ( in_array( $index, $asked_questions ) )
return randomQuestion();
$asked_questions[] = $index;
return $questions[ $index ];
}