The easiest is to use an array of arrays instead of variable variables :

$array[1] = array("a","b","c");

$array[2] = array("1","2","3");

$array[3] = array("a","b","c");

$array[4] = array("e","f","g");

$array[5] = array("7","6","5");

$randnumber = rand(1,5); // ATTENTION : you had an "$" too much ...

if(array_search($string,$array[$randnumber])) // if $randnumber is 2, use $array2 and etc...

{

...

}

$array[1] = array("a","b","c");

$array[2] = array("1","2","3");

$array[3] = array("a","b","c");

$array[4] = array("e","f","g");

$array[5] = array("7","6","5");

$randnumber = rand(1,5); // ATTENTION : you had an "$" too much ...

if(array_search($string,$a

{

...

}