IsValidReplacementString
@param string $str
@return bool
506859
private static function IsValidReplacementString( $str )
	{
		// $charArr = explode( "", $str);
		for ( $k = 0; $k < strlen( $str ); $k++ )
		{
		    if ( $str[ $k ] == '\\' )
		    {
			   if ( $k < strlen( $str ) - 1 && ( $str[ $k + 1 ] == '\\' || $str[ $k + 1 ] == '$' ) )
				  $k++;
			   else
				  return false;
		    }
		    if ( $str[ $k ] == '$' )
		    {
			   if ( $k < strlen( $str ) - 1 && is_numeric( $str[ $k + 1 ] ) )
				  $k++;
			   else
				  return false;
		    }
		}
		return true;
	}
1187029
public static function restoreLineBreaks($str)
    {
        if (isset($str) and strlen($str) !== 0) {
            $result = str_replace(PHP_EOL, "\n\r<br />\n\r", $str);

            return $result;
        } else {
            return false;
        }
    }
600067
public static function parse($str)
    {
        if (preg_match('#\{:.*?:\}#', $str) === 0) {
            return false;
        }

        $str = preg_replace('#' . self::$rearg . '#', '\\\$0', $str);
        return preg_replace_callback('#\\\{:.*?:\\\}#',
                    array( '\\' . get_called_class(), 'args' ), $str);
    }
411701
private function isPlaceholder(string $value) : bool
    {
        if (strrchr($value, '}') && (0 === strpos($value, '{'))) {
            return true;
        }

        return false;
    }
157202
public static function strExists($str, $string)
    {
        $string = (string) $string;
        $str    = (string) $str;
        return strstr($string, $str) === false ? false : true;
    }
243490
protected function checkString(string $str, int $offset = 0): bool
    {
        return $this->checkForBytes($this->toBytes($str), $offset);
    }
513746
protected static function ourStrlen($str)
    {
        // Premature optimization: cache the function_exists() result
        static $exists = null;
        if ($exists === null) {
            $exists = \function_exists('\\mb_strlen');
        }

        // If it exists, we need to make sure we're using 8bit mode
        if ($exists) {
            return \mb_strlen($str, '8bit');
        }
        return \strlen($str);
    }
1360796
public static function isalnumat($str, $pos)
    {
        if ($pos >= strlen($str))
            return false;

        return (QRinput::lookAnTable(ord($str[$pos])) >= 0);
    }
492159
public function _quote($str)
	{
		// Check that the current value is a string,
		// and is not already quoted before quoting
		// that value, otherwise, return the original value
		return (
			\is_string($str)
			&& strpos($str, $this->escapeCharOpen) !== 0
			&& strrpos($str, $this->escapeCharClose) !== 0
		)
			? "{$this->escapeCharOpen}{$str}{$this->escapeCharClose}"
			: $str;

	}
890690
protected function isRaw($str, /*# bool */ $rawMode)/*# : bool */
    {
        if ($rawMode) {
            return true;
        }

        if (is_string($str)) {
            return (bool) preg_match('/[^0-9a-zA-Z\$_.]/', $str);
        }

        return is_object($str);
    }
962946
public static function strFindAndReplaceAll($vars = array(), $str)
    {
        if (array_count_values($vars) > 0){
            foreach ($vars as $key => $val) {
                for ($i = substr_count($str, $key); $i > 0; $i--) {
                    $str = \WebCMS\Helpers\SystemHelper::strlReplace($key, $val, $str);
                }
            }
        }
        return $str;
    }
23683
public function drainIfMatch($str)
    {
        if (!isset($this->bev)) {
            return false;
        }
        $in = $this->bev->input;
        $l = mb_orig_strlen($str);
        $ll = $in->length;
        if ($ll === 0) {
            return $l === 0 ? true : null;
        }
        if ($ll < $l) {
            return $in->search(substr($str, 0, $ll)) === 0 ? null : false;
        }
        if ($ll === $l) {
            if ($in->search($str) === 0) {
                $in->drain($l);
                return true;
            }
        } elseif ($in->search($str, 0, $l) === 0) {
            $in->drain($l);
            return true;
        }
        return false;
    }
1363195
public function validateLicenseUrl($str)
    {
        if ($str) {
            return ( $this->validateUrl($str) || $this->validatePackageName($str));
        }
        return true;
    }
833891
private static function check($str)
    {
        for ($i=0; $i<strlen($str); $i++) {
            if (ord($str[$i]) < 0x80) continue; # 0bbbbbbb
            elseif ((ord($str[$i]) & 0xE0) == 0xC0) $n=1; # 110bbbbb
            elseif ((ord($str[$i]) & 0xF0) == 0xE0) $n=2; # 1110bbbb
            elseif ((ord($str[$i]) & 0xF8) == 0xF0) $n=3; # 11110bbb
            elseif ((ord($str[$i]) & 0xFC) == 0xF8) $n=4; # 111110bb
            elseif ((ord($str[$i]) & 0xFE) == 0xFC) $n=5; # 1111110b
            else return false; # Does not match any model
            for ($j=0; $j<$n; $j++) { # n bytes matching 10bbbbbb follow ?
                if ((++$i == strlen($str)) || ((ord($str[$i]) & 0xC0) != 0x80))
                    return false;
            }
        }
        return true;
    }
280211
public static function isAlpha($str)
    {
        if (!is_string($str)) {
            throw new \ErrorException('Accept string ' . gettype($str) . ' given');
        }

        return (bool) preg_match('/^[a-zA-Z]+$/', $str);
    }
776995
private static function str_replace($s,$r,$str)
    {
        if(!is_array($s)){
            $s = '!'.preg_quote($s,'!').'!u';
        }else{
            foreach ($s as $k => $v) {
                $s[$k] = '!'.preg_quote($v).'!u';
            }
        }
        return preg_replace($s,$r,$str);
    }
200853
private function isValidText($string)
    {
        $search = array(" ", "　", "\n", "\r", "\t");
        $replace = array("", "", "", "", "");
        return str_replace($search, $replace, $string) !== '';
    }