Nilesh
answered Feb 17 '22 00:00
suppose you want extract text between span tag code will in php as below :
$html='<span class="a-size">Html goes here</span>';
$spantag = '/<span class="a-size">(?P<val>[^>]*)<\/span>/';
preg_match_all($spantag,$html,$text);
print_r($text);
preg_match_all will extract text between span tag by regex .
it will print text between all span tag in html