preg_match_all(
string $pattern,
string $subject,
array &$matches = null,
int $flags = 0,
int $offset = 0
): int|false
Given a HTML string, return an array of the image tags in the string.
public function extractImageTags(string $html) : array {
$hasMatch = preg_match_all('/<img.*?>/', $html, $matches);
return ($hasMatch) ? $matches[0] : [];
}