private function setStartFromText($text) {
        if ($this->starting_text === null) {
            // If we have a forced table at the start, we get that one...
            if (is_array($text)) {
                if (is_array($text[0])) {
                    // Code like array(array(ENCODING, ''))
                    $this->starting_text = $this->METHOD[$text[0][0]];
                    return;
                } else {
                    if (is_string($text[0])) {
                        // Code like array('test') (Automatic text)
                        $text = $text[0];
                    } else {
                        // Code like array(ENCODING, '')
                        $this->starting_text = $this->METHOD[$text[0]];
                        return;
                    }
                }
            }

            // At this point, we had an "automatic" table selection...
            // If we can get at least 4 numbers, go in C; otherwise go in B.
            $tmp = preg_quote($this->keysC, '/');
            $length = strlen($text);
            if ($length >= 4 && preg_match('/[' . $tmp . ']/', substr($text, 0, 4))) {
                $this->starting_text = 'C';
            } else {
                if ($length > 0 && strpos($this->keysB, $text[0]) !== false) {
                    $this->starting_text = 'B';
                } else {
                    $this->starting_text = 'A';
                }
            }
        }
    }
private function setStartFromText($text) {
        if ($this->starting_text === null) {
            // If we have a forced table at the start, we get that one...
            if (is_array($text)) {
                if (is_array($text[0])) {
                    // Code like array(array(ENCODING, ''))
                    $this->starting_text = $this->METHOD[$text[0][0]];
                    return;
                } else {
                    if (is_string($text[0])) {
                        // Code like array('test') (Automatic text)
                        $text = $text[0];
                    } else {
                        // Code like array(ENCODING, '')
                        $this->starting_text = $this->METHOD[$text[0]];
                        return;
                    }
                }
            }

            // At this point, we had an "automatic" table selection...
            // If we can get at least 4 numbers, go in C; otherwise go in B.
            $tmp = preg_quote($this->keysC, '/');
            $length = strlen($text);
            if ($length >= 4 && preg_match('/[' . $tmp . ']/', substr($text, 0, 4))) {
                $this->starting_text = 'C';
            } else {
                if ($length > 0 && strpos($this->keysB, $text[0]) !== false) {
                    $this->starting_text = 'B';
                } else {
                    $this->starting_text = 'A';
                }
            }
        }
    }
private function setStartFromText ( $ text ) { if ( $ this -> starting_text === null ) { // If we have a forced table at the start, we get that one...
 if ( is_array ( $ text ) ) { if ( is_array ( $ text [ 0 ] ) ) { // Code like array(array(ENCODING, ''))
 $ this -> starting_text = $ this -> METHOD [ $ text [ 0 ] [ 0 ] ] ; return ; } else { if ( is_string ( $ text [ 0 ] ) ) { // Code like array('test') (Automatic text)
 $ text = $ text [ 0 ] ; } else { // Code like array(ENCODING, '')
 $ this -> starting_text = $ this -> METHOD [ $ text [ 0 ] ] ; return ; } } } // At this point, we had an "automatic" table selection...
 // If we can get at least 4 numbers, go in C; otherwise go in B.
 $ tmp = preg_quote ( $ this -> keysC , '/' ) ; $ length = strlen ( $ text ) ; if ( $ length >= 4 && preg_match ( '/[' . $ tmp . ']/' , substr ( $ text , 0 , 4 ) ) ) { $ this -> starting_text = 'C' ; } else { if ( $ length > 0 && strpos ( $ this -> keysB , $ text [ 0 ] ) !== false ) { $ this -> starting_text = 'B' ; } else { $ this -> starting_text = 'A' ; } } } }
Specifies the starting_text table if none has been specified earlier.

@param string $text
Specifies the starting_text table if none has been specified earlier .