A convenience wrapper around strpos to check the start of a string
From http://stackoverflow.com/a/860509/270334
@return boolean $startswithneedle string starts with $needle
491966
private function startsWith($haystack,$needle,$case=true)
    {
        if($case)
            return strpos($haystack, $needle, 0) === 0;
        return stripos($haystack, $needle, 0) === 0;
    }
679380
public function startsWith($string)
	{
		$string = static::_convertString($string, $this->encoding);
		return $string === $this->substring(0, mb_strlen($string, $this->encoding)-1)->__toString();
	}
1305279
public static function getStartsWith($haystack, $needles)
    {
        foreach ((array) $needles as $needle) {
            if ($needle != '' && strpos($haystack, $needle) === 0) {
                return $needle;
            }
        }

        return false;
    }
137790
public static function strStr($haystack, $needle, $beforeNeedle = false)
    {
        if (self::isMBString()) {
            return mb_strstr($haystack, $needle, $beforeNeedle, self::$encoding);
        }

        return strstr($haystack, $needle, $beforeNeedle); // @codeCoverageIgnore
    }
111756
public static function startsWith($haystack, $needle)
    {
        return $needle === '' or mb_strrpos($haystack, $needle, -mb_strlen($haystack)) !== false;
    }
252547
public function startsWith(Value $value, $insensitive = false)
    {
        $value = $value->getValue();
        $valueLength = strlen($value);

        if (!empty($this->value) && !empty($value) && strlen($this->value) >= $valueLength) {
            return substr_compare($this->value, $value, 0, $valueLength, $insensitive) === 0;
        }

        return false;
    }
154663
protected function isStartWith($haystack, $needles) {
        if (!is_array($needles)) {
            $needles = array($needles);
        }
        foreach ($needles as $needle) {
            if (substr($haystack, 0, strlen($needle)) === $needle) {
                return true;
            }
        }
        return false;
    }
720553
public static function startsWith($string, $beginning)
    {
        if (!empty($string) && !empty($beginning)) {
            if (1 === strlen($beginning) && !self::isLetterOrDigit($beginning)) {
                $beginning = '\\' . $beginning;
            }

            $pattern = sprintf('|^%s|', $beginning);

            return (bool)preg_match($pattern, $string);
        }

        return false;
    }
543693
private function initHelpers() {
		/**
		 * @param string $haystack
		 * @param string $needle
		 * @return bool
		 */
		$this->helpers['startsWith'] = function ($haystack, $needle) {
			$needleLen = strlen($needle);
			return substr($haystack, 0, $needleLen) == $needle;
		};
		
		/**
		 * @param string $haystack
		 * @param string $needle
		 * @return bool
		 */
		$this->helpers['endsWith'] = function ($haystack, $needle) {
			$haystackLen = strlen($haystack);
			$needleLen = strlen($needle);
			return substr($haystack, $haystackLen - $needleLen, $needleLen) == $needle;
		};
	}
455506
public static boolean startsWith(String str, char prefix) {
	return str != null && str.length() > 0 && str.charAt(0) == prefix;
    }
52253
public function compareStart($string)
    {
        $lowerString = strtolower($string);
        foreach ($this->tokens as $token) {
            if (strpos($lowerString, strtolower($token)) === 0) {
                $this->found = true;
            }
        }
    }
185488
function string_starts_with(str, what) {
		return (str.substr(0, what.length) === what) ? true : false;
	}
433026
public static function startsWith($needle, $haystack, $caseSensitive = true)
    {
        if (!self::isValid($needle)) {
            return false;
        }

        list($needle, $haystack) = self::transformCase($needle, $haystack, $caseSensitive);

        if ($needle === false) {
            return false;
        } else {
            return (self::substring($haystack, 0, self::length($needle)) === $needle);
        }
    }
1268777
private function getStartEndDate()
    {
        $start = input('start', date('Y-m-d', strtotime('-29 days')));
        $end = input('end', date('Y-m-d'));

        if (is_string($start)) {
            $start = \DateTime::createFromFormat('Y-m-d', $start);
        }

        if (is_string($end)) {
            $end = \DateTime::createFromFormat('Y-m-d', $end);
        }

        return compact('start', 'end');
    }
203527
function startsWith (haystack, needle, startPosition) {
    startPosition = startPosition || 0;
    return haystack.lastIndexOf(needle, startPosition) === startPosition;
  }
541000
public static function startsWith($value, $start)
    {

        if (is_array($value)) {
            return self::first($value) == $start;
        }

        return mb_strpos("$value", "$start") === 0;

    }
477721
public function beginsWith($haystack, $needle, $modifiers = null)
    {
        $this->prepareHaystackAndNeedle($haystack, $needle, $modifiers);
        $parsedModifiers = $this->parseModifiers($modifiers);

        $pattern = '/^' . preg_quote($needle) . '/';

        return (bool)preg_match($pattern . $parsedModifiers, $haystack);
    }