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);
        }
    }
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);
        }
    }
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 ) ; } }
Check if string starts with another string

@param string $needle String to look for
@param string $haystack String to check
@param bool $caseSensitive Case sensitive check

@return bool
Check if string starts with another string