private function _matrixLexer($lexBase)
    {
        // get the lex-base' areas
        foreach ($lexBase as $area => $content) {
            if (!is_array($content)) {
                // get default char(s)
                $charMatrix = explode(',', $content);

                // new empty matrix
                $matrix = [];

                // get count of elements
                $countCharMatrix = count($charMatrix);

                // iterate over char array
                for ($i = 0; $i < $countCharMatrix; ++$i) {
                    // check if it is a range or single char
                    if (stristr($charMatrix[$i], '-')) {
                        $tmp = explode('-', $charMatrix[$i]);
                        // change values if 1st value greater 2nd value!
                        ($tmp[0] > $tmp[1]) ? ($tmp[0] ^= $tmp[1] ^= $tmp[0] ^= $tmp[1]) : '';
                        // iterate amd build
                        for ($j = $tmp[0]; $j <= $tmp[1]; ++$j) {
                            $matrix[] = chr((int) $tmp[0]);
                            ++$tmp[0];
                        }
                    } else {
                        $matrix[] = chr((int) $charMatrix[$i]);
                    }
                }
                // remove possible duplicate values (chars)
                $tmp    = array_unique($matrix);
                $matrix = [];
                foreach ($tmp as $elem) {
                    $matrix[] = $elem;
                }

                // remount
                $lexBase[$area] = $matrix;
            }
        }

        // return lexed result (array)
        return $lexBase;
    }
private function _matrixLexer($lexBase)
    {
        // get the lex-base' areas
        foreach ($lexBase as $area => $content) {
            if (!is_array($content)) {
                // get default char(s)
                $charMatrix = explode(',', $content);

                // new empty matrix
                $matrix = [];

                // get count of elements
                $countCharMatrix = count($charMatrix);

                // iterate over char array
                for ($i = 0; $i < $countCharMatrix; ++$i) {
                    // check if it is a range or single char
                    if (stristr($charMatrix[$i], '-')) {
                        $tmp = explode('-', $charMatrix[$i]);
                        // change values if 1st value greater 2nd value!
                        ($tmp[0] > $tmp[1]) ? ($tmp[0] ^= $tmp[1] ^= $tmp[0] ^= $tmp[1]) : '';
                        // iterate amd build
                        for ($j = $tmp[0]; $j <= $tmp[1]; ++$j) {
                            $matrix[] = chr((int) $tmp[0]);
                            ++$tmp[0];
                        }
                    } else {
                        $matrix[] = chr((int) $charMatrix[$i]);
                    }
                }
                // remove possible duplicate values (chars)
                $tmp    = array_unique($matrix);
                $matrix = [];
                foreach ($tmp as $elem) {
                    $matrix[] = $elem;
                }

                // remount
                $lexBase[$area] = $matrix;
            }
        }

        // return lexed result (array)
        return $lexBase;
    }
private function _matrixLexer ( $ lexBase ) { // get the lex-base' areas foreach ( $ lexBase as $ area => $ content ) { if ( ! is_array ( $ content ) ) { // get default char(s) $ charMatrix = explode ( ',' , $ content ) ; // new empty matrix $ matrix = [ ] ; // get count of elements $ countCharMatrix = count ( $ charMatrix ) ; // iterate over char array for ( $ i = 0 ; $ i < $ countCharMatrix ; ++ $ i ) { // check if it is a range or single char if ( stristr ( $ charMatrix [ $ i ] , '-' ) ) { $ tmp = explode ( '-' , $ charMatrix [ $ i ] ) ; // change values if 1st value greater 2nd value! ( $ tmp [ 0 ] > $ tmp [ 1 ] ) ? ( $ tmp [ 0 ] ^= $ tmp [ 1 ] ^= $ tmp [ 0 ] ^= $ tmp [ 1 ] ) : '' ; // iterate amd build for ( $ j = $ tmp [ 0 ] ; $ j <= $ tmp [ 1 ] ; ++ $ j ) { $ matrix [ ] = chr ( ( int ) $ tmp [ 0 ] ) ; ++ $ tmp [ 0 ] ; } } else { $ matrix [ ] = chr ( ( int ) $ charMatrix [ $ i ] ) ; } } // remove possible duplicate values (chars) $ tmp = array_unique ( $ matrix ) ; $ matrix = [ ] ; foreach ( $ tmp as $ elem ) { $ matrix [ ] = $ elem ; } // remount $ lexBase [ $ area ] = $ matrix ; } } // return lexed result (array) return $ lexBase ; }
lexes a given array to usable char representation.

This method is intend to lex a given array to usable char representation.

@param array $lexBase The input to lex to usable char representation array.

@author Benjamin Carl <opensource@clickalicious.de>

@return string The lexed array of chars
lexes a given array to usable char representation .