I want this:
<h2>My Headline</h2>
to this:
<span class="h2">My Headline</span>
I tried this, but this is just a way to remove the h-tag with the content :/
$introtext = preg_replace('/<h2[^>]*>([\s\S]*?)<\/h2[^>]*>/', '', $introtext);
Maybe there is a solution to "convert" all h-tags into span-tags with the right class?
Thanks for support.
Another idea to change the tags, was this:
$introOld = array('/<h2>/','/</h2>/');
$introNew = array('<span class="h2">','</span>');
$introtext = preg_replace($introOld, $introNew, $introtext);
Maybe this will be help to show, what I mean/want.
I have on content ($introtext) and to views (teaser [categoryView] and detail [articleView]). For the categoryView I want change all h-tags into span-tags, because of the category description. If the articleView is shown, h-tags are okay.