function Scanner::sequenceMatches
Check if upcomming chars match the given sequence.
This will read the stream for the $sequence. If it's found, this will return true. If not, return false. Since this unconsumes any chars it reads, the caller will still need to read the next sequence, even if this returns true.
Example: $this->scanner->sequenceMatches('</script>') will see if the input stream is at the start of a '</script>' string.
Parameters
string $sequence:
bool $caseSensitive:
Return value
bool
File
-
vendor/
masterminds/ html5/ src/ HTML5/ Parser/ Scanner.php, line 83
Class
- Scanner
- The scanner scans over a given data input to react appropriately to characters.
Namespace
Masterminds\HTML5\ParserCode
public function sequenceMatches($sequence, $caseSensitive = true) {
$portion = substr($this->data, $this->char, strlen($sequence));
return $caseSensitive ? $portion === $sequence : 0 === strcasecmp($portion, $sequence);
}