PHP Regex find text between custom added HTML Tags

Assuming <PRODUCT_LIST> tags will never be nested

preg_match_all('/<PRODUCT_LIST>(.*?)<\/PRODUCT_LIST>/s', $html, $matches);

//HTML array in $matches[1]
print_r($matches[1]);

Leave a Comment