PHP: $random = array_rand($this->getOwner()->battle1, 2); unset($this->battle2[$random[0]]);unset($this->battle2[$random[1]]);$this->getOwner()->zombie2 = $random[0];$this->getOwner()->zombie2 = $random[1]; Why does that not work? PS: Its in a task and the array works and so
Array_rand method does not return an array, it returns a random key from an array. http://php.net/manual/en/function.array-rand.php