How to search src
and srcset
tag in string using php ?
Normally i use this code for search src
tag in $source
string
preg_match_all('/< *img[^>]*src *= *["\']?([^"\']*)/i', $source, $output);
$src_tag_length = count($output[0]);
Then i want to search src
and srcset
tag in $source
string using php.
How can i do that ?
preg_match_all('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', $source, $output);
$src_srcset_tag_length = count($output[0]);