Wrapper For strpos()

@param string $haystack Haystack.
@param string $needle Needle.
@param int $offset Offset.
@return int|bool Last occurrence or false.
169729
public static function strrpos(string $haystack, string $needle, int $offset=0) {
		if (\function_exists('mb_strrpos')) {
			return \mb_strrpos($haystack, $needle, $offset, 'UTF-8');
		}
		else {
			return \strrpos($haystack, $needle, $offset);
		}
	}
1285782
public static function startsWith($haystack, $needle) {
		if($needle === null && $haystack === null)
			return false;
		if($needle === null && $haystack !== null)
			return true;
		return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== false;
	}
690571
public static function inString($needle, $haystack, $insensitive = false)
    {
        if ($insensitive) {
            return false !== stristr($haystack, $needle);
        }

        return false !== strpos($haystack, $needle);
    }
758926
private function arraySearch( $needle, array $haystack ) {
		foreach ( $haystack as $valueOffset => $thing ) {
			if ( $this->valueComparer->valuesAreEqual( $needle, $thing ) ) {
				return $valueOffset;
			}
		}

		return false;
	}
229443
public static function StartsWith($haystack, $needle)
    {
        $length = static::Length($needle);

        return substr($haystack, 0, $length) === $needle;
    }
417654
public static function stringEndsWith($haystack, $needle)
    {
        if (substr($haystack, - strlen($needle)) === $needle) {
            return true;
        }

        return false;
    }
31724
public static function hasBeginning(string $needle, string $haystack): bool
    {
        return $needle === '' || strpos($haystack, $needle) === 0;
    }
644279
public static function endsWith($haystack, $needle)
    {
        $length = strlen($needle);
        if ($length == 0) {
            throw new \Exception("Needle must be one or more characters");
        }

        return (substr($haystack, -$length) === $needle);
    }
1303849
public function strpos($needle, $offset = 0)
    {
        $function = static::$functions[(int) static::$useMbstring]['strpos'];

        return $function($this->string, $needle, $offset);
    }
413644
public static function targetGet($needle, array $haystack, $default = null)
    {
        if ($needle === null) {
            return $haystack;
        }

        $parts  = preg_split('/(?<!\\\\)\./', $needle);

        foreach ($parts as $part) {
            $key = str_replace('\\.', '.', $part);

            if (
                is_array($haystack) === false ||
                array_key_exists($key, $haystack) === false
            ) {
                return $default;
            }

            $haystack = $haystack[$part];
        }

        return $haystack;
    }
1293537
public function endswith(string $haystack, string $needle) : bool
    {
        return (substr($haystack, -1 * strlen($needle)) === $needle);
    }
441400
public static function startsWith($haystack, $needle)
    {
        $length = strlen($needle);

        return substr($haystack, 0, $length) === $needle;
    }
1305625
public static function endsWith($haystack, $needle)
    {
        return $needle == substr($haystack, strlen($haystack) - strlen($needle));
    }
166171
public static function strrpos($haystack, $needle, $offset = null)
    {
        // Emulate strrpos behaviour (no warning)
        if (empty($haystack)) {
            return false;
        }

        return mb_strrpos($haystack, $needle, (int) $offset, static::ENC_UTF8);
    }
1155251
public static function endsWith($haystack, $needle) {
		if($needle === null && $haystack === null)
			return true;
		if($needle === null && $haystack !== null)
			return true;
		return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);
	}
119567
public static function RearPosition ($haystack, $needle, $offset = 0, $encoding = Encoding::DEFAULT_ENCODING) {
		return mb_strrpos($haystack, $needle, $offset, $encoding);
	}
623563
public static function subStringAfterLast($haystack, $needle, $n = 1)
    {
        $string = "";
        while ($n>0) {
            $string .= substr($haystack, strrpos($haystack, $needle) + 1);
            if($n>1){
                $string = $needle . $string;
            }
            $n--;
        }
        return $string;
    }