I'm using preg_replace, and basically I want to match a certain HTML tag and turn it into a <div>. So I want to take these:
And change them to these:
This is the pattern I used with my preg_replace function:
That pattern matches the <cut>Some more content</cut>, but it does not match the <cut title="titletext">Some content</cut> one.
Obviously I must be doing something wrong, but what? I would think using <cut.*> would accept <cut> or <cut ANYTHING>.
Code:
<cut title="titletext">Some content</cut>
<cut>Some more content</cut>
And change them to these:
Code:
<div class="cut">Some content</div>
<div class="cut">Some more content</div>
This is the pattern I used with my preg_replace function:
Code:
/<cut.*>(.*)<\/cut>/s
That pattern matches the <cut>Some more content</cut>, but it does not match the <cut title="titletext">Some content</cut> one.
Obviously I must be doing something wrong, but what? I would think using <cut.*> would accept <cut> or <cut ANYTHING>.