Я не знаю, что такое readStack()
и storeStack()
, но вы, вероятно, хотите что-то вроде
$arr = array('https://domain1.com', 'https://domain2.com');
shuffle($arr); // This returns a boolean and the array is modified inside the function so just pass in the array
$url=array_pop($arr); // Pop the top most element from the array and store into $url
header("Location: $url");
Один только этот код дает вам случайный URL из этих двух