public function getSequence($choices, $length)
    {
        $length = (int) $length;

        if ($length < 0) {
            throw new \InvalidArgumentException('Invalid sequence length');
        }

        if (is_array($choices)) {
            return $this->getSequenceValues(array_values($choices), $length);
        }

        return implode($this->getSequenceValues(str_split((string) $choices), $length));
    }
public function getSequence($choices, $length)
    {
        $length = (int) $length;

        if ($length < 0) {
            throw new \InvalidArgumentException('Invalid sequence length');
        }

        if (is_array($choices)) {
            return $this->getSequenceValues(array_values($choices), $length);
        }

        return implode($this->getSequenceValues(str_split((string) $choices), $length));
    }
public function getSequence ( $ choices , $ length ) { $ length = ( int ) $ length ; if ( $ length < 0 ) { throw new \ InvalidArgumentException ( 'Invalid sequence length' ) ; } if ( is_array ( $ choices ) ) { return $ this -> getSequenceValues ( array_values ( $ choices ) , $ length ) ; } return implode ( $ this -> getSequenceValues ( str_split ( ( string ) $ choices ) , $ length ) ) ; }
Returns a random sequence of values.

If a string is provided as the first argument, the method returns a
string with characters selected from the provided string. The length of
the returned string is determined by the second argument.

If an array is provided as the first argument, the method returns an
array with elements selected from the provided array. The size of the
returned array is determined by the second argument.

The functionality is similar to getArray(), except for the fact that the
returned value can contain the same character or element multiple times.
If the same character or element appears multiple times in the provided
argument, it will increase the relative chance of it appearing in the
returned value.

@param string|array $choices Values to choose from
@param int $length Length of the sequence
@return array|string The generated random sequence
@throws \InvalidArgumentException If the choices or length is invalid
Returns a random sequence of values .