Get the operator and the value of an input string.

@param string $input

@return array [string operator,string value]
180846
public function getOperatorAndValue($input)
    {
        switch ($this->getType()) {
            case self::TYPE_GREATER:
            case self::TYPE_GREATER_OR_EQUAL:
            case self::TYPE_LESS:
            case self::TYPE_LESS_OR_EQUAL:
            case self::TYPE_NOT_LIKE:
            case self::TYPE_LIKE:
            case self::TYPE_NOT_EQUAL:
            case self::TYPE_EQUAL_STRICT:
            case self::TYPE_LIKE_WORDS_AND:
            case self::TYPE_LIKE_WORDS_OR:
                return array($this->getType(), $input);
            case self::TYPE_AUTO:
            default:
                // handle blank search is different to search 0 value
                if ((string) $input != '') {
                    $simpleOperator = substr($input, 0, 1);
                    $doubleOperator = substr($input, 0, 2);
                    // if start with operators
                    switch ($doubleOperator) {
                        case self::TYPE_GREATER_OR_EQUAL:
                        case self::TYPE_LESS_OR_EQUAL:
                        case self::TYPE_NOT_EQUAL:
                        case self::TYPE_EQUAL_STRICT:
                            return array($doubleOperator, substr($input, 2));
                            break;
                        default:
                            switch ($simpleOperator) {
                                case self::TYPE_GREATER:
                                case self::TYPE_LESS:
                                case self::TYPE_EQUAL:
                                case self::TYPE_NOT_LIKE:
                                    return array($simpleOperator, substr($input, 1));
                                    break;
                                default:
                                    return array(self::TYPE_LIKE, $input);
                                    break;
                            }
                            break;
                    }
                    break;
                }

                    return array(self::TYPE_LIKE, false);
        }
    }
490213
public function parse($input)
    {
        $queries = new AndQuery();

        foreach (explode(',', $input) as $query) {
            list($property, $value) = explode('=', $query);

            $queries->add(new Equal($property, $value));
        }

        return $queries;
    }
1111990
public function load($input)
    {
        return array_map(
            function (SplFileInfo $file) {
                return $file->getContents();
            },
            array_values(iterator_to_array($this->getFinder($input)))
        );
    }
274002
protected function parseRange($input): ?array
    {
        if ($input === null || $input === '*' || $input === '*.*.*.*'
            || $input === '0.0.0.0-255.255.255.255'
        ) {
            return null;
        }

        $range = ['min' => null, 'max' => null, 'mask' => null];

        if (strpos($input, '-') !== false) {
            [$range['min'], $range['max']] = explode('-', $input);
        } elseif (strpos($input, '*') !== false) {
            $this->parseRangeUsingWildcards($input, $range);
        } elseif (strpos($input, '/') !== false) {
            $this->parseRangeUsingCidr($input, $range);
        } else {
            throw new ComponentException('Invalid network range');
        }

        if (!$this->verifyAddress($range['min'])) {
            throw new ComponentException('Invalid network range');
        }

        if (isset($range['max']) && !$this->verifyAddress($range['max'])) {
            throw new ComponentException('Invalid network range');
        }

        return $range;
    }
1332027
public function formatString($input)
    {
        if (is_array($input)) {
            $input = join(', ', $input);
        }
        $output = strip_tags($input);
        $output = str_replace(array("\r", "\n"), array(' ', ' '), $output);
        
        $output = $this->filterCsvInjection($output);
        
        return $output;
    }
5462
public function parse($input)
    {
        if (strlen($input) == 0) {
            return null;
        }
        return $this->parser->parse(new TokenStream($this->tokenizer->getTokens($input)));
    }
757313
public function parse($input)
    {
        if (is_null($input) || empty($input)) {
            return $input;
        }
        $character = $this->getOption('character');
        $regex = strtr($this->getOption('regex'), $this->getOption('regex_replacement'));

        preg_match_all($regex, $input, $matches);

        $matches = array_map([$this, 'mapper'], $matches[0]);

        $matches = $this->removeNullKeys($matches);
        $matches = $this->prepareArray($matches);

        $output = preg_replace_callback($matches, [$this, 'replace'], $input);

        return $output;
    }
812149
private function stringToUtf($input)
    {
        if (is_array($input)) {
            $temp = array();
            foreach ($input as $key => $value) {
                $temp[$this->stringToUtf($key)] = $this->stringToUtf($value);
            }
            $input = $temp;
        } elseif (is_string($input)) {
            $input = iconv('iso-8859-15', 'utf-8', $input);
        }

        return $input;
    }
907603
public function getEncQuoted($input) {

        if (is_array($input)) {
            foreach ($input as $key=>$content) {
                $input[$key] = $this->getEncQuoted($content);
            }
            return $input;
        } else {
            // Always lowercase
            $input = strtolower($input);
            // if reserved or quote_all or has hyphens, quote it
            if ($this->quote_all || in_array($input, $this->reserved_words) || strpos($input, '-') !== false) {
                $input = $this->quote_string . $input . $this->quote_string;
            }
            return $input;
        }
    }
795061
private static function _prepareQuestionString($input)
    {
        $regex = '';
        if (is_array($input) === true) {
            $regex = '^';
            $start = true;
            foreach ($input as $row) {
                if ($start === false) {
                    $regex .= '|';
                }

                $start  = false;
                $regex .= '(';
                $one    = null;
                if (strlen($row) > 2) {
                    $one = true;
                }

                foreach (str_split($row, 1) as $char) {
                    $regex .= '[' . $char;
                    $regex .= strtoupper($char) . ']';
                    if ($one === true) {
                        $one    = false;
                        $regex .= '(';
                    }
                }

                if ($one === false) {
                    $regex .= ')';
                }

                $regex .= '?)';
            }
        }

        return $regex;
    }
957944
protected function toBuffer($input)
    {
        if (is_string($input)) {
            if (strpos($input, '0x') === 0) {
                // hex string
                // $input = str_replace('0x', '', $input);
                return new Buffer($input, 'hex');
            }
            return new Buffer(str_split($input, 1));
        } elseif (is_numeric($input)) {
            if (!$input || $input < 0) {
                return new Buffer([]);
            }
            if (is_float($input)) {
                $input = number_format($input, 0, '', '');
                var_dump($input);
            }
            $gmpInput = gmp_init($input, 10);
            return new Buffer('0x' . gmp_strval($gmpInput, 16), 'hex');
        } elseif ($input === null) {
            return new Buffer([]);
        } elseif (is_array($input)) {
            return new Buffer($input);
        } elseif ($input instanceof Buffer) {
            return $input;
        }
        throw new InvalidArgumentException('The input type didn\'t support.');
    }
1024167
protected function _getSettings($input)
    {
        $parts = array ();
        $matches = array ();
        if (1 === preg_match('/^\$sha1\$(\d+)\$([\.\/0-9A-Za-z]{0,64})(?:\$([\.\/0-9A-Za-z]{28}))?$/', rtrim($input, '$'), $matches)) {
            $parts['rounds'] = $matches[1];
            $parts['salt'] = $matches[2];
            $parts['checksum'] = $matches[3] ?: null;
        }

        return $parts;
    }
375242
public function matched($input)
    {
        if ($this->token instanceof Token) {
            return $this->token->matched($input);
        }
        
        return $input;
    }
1342462
public function parse($input)
    {
        $sorting = new Sort();

        foreach (explode('|', $input) as $property) {
            if ($property[0] === '-') {
                $sorting->add(new Sort\Desc(substr($property, 1)));
                continue;
            }
            $sorting->add(new Sort\Asc($property));
        }

        return $sorting;
    }
187550
public function parse($input)
	{
		// Parse input
		$tidy = new PhpTidy;
		$tidy->parseString($input, $this->tidy_options, $this->encoding);
		$tidy->cleanRepair();

		// Set doctype
		$output = $this->doctype . "\n" . preg_replace('_ xmlns="http://www.w3.org/1999/xhtml"_', null, $tidy, 1);

		// Append errors
		if ($this->display_errors and $tidy->getStatus())
		{
			// Omit ignored errors
			$errors = $tidy->errorBuffer;
			foreach($this->ignored_errors as $regex)
				$errors = preg_replace($regex, null, $errors);

			// Wrap errors in a container
			if (strlen($errors))
				$errors = $this->container_open_tag . nl2br(htmlentities($errors)) . $this->container_close_tag;

			// Append errors at the end of the document
			$output = str_replace('</body>', $errors . '</body>', $output);
		}

		return $output;
	}
270151
protected function decodeToData($input)
    {
        $output = [];

        if (is_array($input)) {
            $output = $this->arrayToData($input);
        } elseif (is_int($input)) {
            $output = $this->intToData($input);
        } elseif (is_numeric($input)) {
            $output = $this->numericToData($input);
        } elseif (is_string($input)) {
            $output = $this->stringToData($input, $this->encoding);
        }
        return $output;
    }
818884
public static function clean($input)
    {
        // handle input of type array
        if (is_array($input)) {
            foreach ($input as $idx => $val) {
                $input[$idx] = self::clean($val);
            }
            return $input;
        }

        if (!is_string($input) || $input == '') {
            return $input;
        }

        // iconv/mbstring are much faster (especially with long strings)
        if (function_exists('mb_convert_encoding')) {
            $msch = mb_substitute_character();
            mb_substitute_character('none');
            $res = mb_convert_encoding($input, 'UTF-8', 'UTF-8');
            mb_substitute_character($msch);

            if ($res !== false) {
                return $res;
            }
        }

        if (function_exists('iconv')) {
            if (($res = @iconv('UTF-8', 'UTF-8//IGNORE', $input)) !== false) {
                return $res;
            }
        }

        $seq    = '';
        $out    = '';
        $regexp = '/^('.
//          '[\x00-\x7F]'.                                  // UTF8-1
            '|[\xC2-\xDF][\x80-\xBF]'.                      // UTF8-2
            '|\xE0[\xA0-\xBF][\x80-\xBF]'.                  // UTF8-3
            '|[\xE1-\xEC][\x80-\xBF][\x80-\xBF]'.           // UTF8-3
            '|\xED[\x80-\x9F][\x80-\xBF]'.                  // UTF8-3
            '|[\xEE-\xEF][\x80-\xBF][\x80-\xBF]'.           // UTF8-3
            '|\xF0[\x90-\xBF][\x80-\xBF][\x80-\xBF]'.       // UTF8-4
            '|[\xF1-\xF3][\x80-\xBF][\x80-\xBF][\x80-\xBF]'.// UTF8-4
            '|\xF4[\x80-\x8F][\x80-\xBF][\x80-\xBF]'.       // UTF8-4
            ')$/';

        for ($i = 0, $len = strlen($input); $i < $len; $i++) {
            $chr = $input[$i];
            $ord = ord($chr);

            // 1-byte character
            if ($ord <= 0x7F) {
                if ($seq !== '') {
                    $out .= preg_match($regexp, $seq) ? $seq : '';
                    $seq = '';
                }

                $out .= $chr;
            }
            // first byte of multibyte sequence
            else if ($ord >= 0xC0) {
                if ($seq !== '') {
                    $out .= preg_match($regexp, $seq) ? $seq : '';
                    $seq = '';
                }

                $seq = $chr;
            }
            // next byte of multibyte sequence
            else if ($seq !== '') {
                $seq .= $chr;
            }
        }

        if ($seq !== '') {
            $out .= preg_match($regexp, $seq) ? $seq : '';
        }

        return $out;
    }