src/Generators/CodeGenerator.php
public function generate()
    {
        $chars = $this->validChars();
        $numChars = strlen($chars) - 1;
        $length = $this->getLength();
        $code = array();
        for ($i = 0; $i < $length; ++$i) {
            $code[] = $chars[random_int(0, $numChars)];
        }

        return implode('', $code);
    }
public function generate()
    {
        $chars = $this->validChars();
        $numChars = strlen($chars) - 1;
        $length = $this->getLength();
        $code = array();
        for ($i = 0; $i < $length; ++$i) {
            $code[] = $chars[random_int(0, $numChars)];
        }

        return implode('', $code);
    }
public function generate ( ) { $ chars = $ this -> validChars ( ) ; $ numChars = strlen ( $ chars ) - 1 ; $ length = $ this -> getLength ( ) ; $ code = array ( ) ; for ( $ i = 0 ; $ i < $ length ; ++ $ i ) { $ code [ ] = $ chars [ random_int ( 0 , $ numChars ) ] ; } return implode ( '' , $ code ) ; }
Generate a random resulting string

@return string
Generate a random resulting string