如何从变量中删除内部标记的信息

I have this text in a variable, lets say $textvariable:

<p>Hello everybody I would like</p>
<p><output tipo="youtube" valor="5ZzklOEGW0w"><em>youtube: 5ZzklOEGW0w</em></output></p>
<p>to party a lot</p>
<p><output tipo="youtube" valor="RW2QkfIytRA"><em>youtube: RW2QkfIytRA</em></output></p>
<p>Tonight</p>

And I would like to remove what's insede and leave it like this:

<p>Hello everybody I would like</p>
<p><output tipo="youtube" valor="5ZzklOEGW0w"></output></p>
<p>to party a lot</p>
<p><output tipo="youtube" valor="RW2QkfIytRA"></output></p>
<p>Tonight</p>

I know the regex to find the info inside:

#<output>(.*?)</output>#

But how can I remove all information inside this tags? That can be more than one or two of this in a variable

Thanks!

You can use preg_replace

preg_replace('/(<output[^>]*>)(.*?)(<\/output>)/i', '$1$3', $html);