src/Gregwar/Captcha/PhraseBuilder.php
public function build($length = null, $charset = null)
    {
        if ($length !== null) {
            $this->length = $length;
        }
        if ($charset !== null) {
            $this->charset = $charset;
        }

        $phrase = '';
        $chars = str_split($this->charset);

        for ($i = 0; $i < $this->length; $i++) {
            $phrase .= $chars[array_rand($chars)];
        }

        return $phrase;
    }
public function build($length = null, $charset = null)
    {
        if ($length !== null) {
            $this->length = $length;
        }
        if ($charset !== null) {
            $this->charset = $charset;
        }

        $phrase = '';
        $chars = str_split($this->charset);

        for ($i = 0; $i < $this->length; $i++) {
            $phrase .= $chars[array_rand($chars)];
        }

        return $phrase;
    }
public function build ( $ length = null , $ charset = null ) { if ( $ length !== null ) { $ this -> length = $ length ; } if ( $ charset !== null ) { $ this -> charset = $ charset ; } $ phrase = '' ; $ chars = str_split ( $ this -> charset ) ; for ( $ i = 0 ; $ i < $ this -> length ; $ i ++ ) { $ phrase .= $ chars [ array_rand ( $ chars ) ] ; } return $ phrase ; }
Generates  random phrase of given length with given charset
Generates random phrase of given length with given charset