FluentDOM\Loader\Supports::startsWith PHP Method

startsWith() private method

Allow the loaders to validate the first part of the provided string.
private startsWith ( string $haystack, string $needle, boolean $ignoreWhitespace = TRUE ) : boolean
$haystack string
$needle string
$ignoreWhitespace boolean
return boolean
    private function startsWith($haystack, $needle, $ignoreWhitespace = TRUE)
    {
        $pattern = $ignoreWhitespace ? '(^\\s*' . preg_quote($needle) . ')' : '(^' . preg_quote($needle) . ')';
        return (bool) preg_match($pattern, $haystack);
    }