PHP:如何在不删除太多字符的情况下删除2个字符串之间的字符串部分?

This problem is driving me nuts. Let's say I have a string:

This is a &start;pretty bad&end; string that I want to &start;somehow&end; display differently

I want to be able to remove the &start; and &end; parts as well as everything in between so it says:

This is a  string that I want to  display differently

I tried using preg_replace with a regular expression but it took off too much, ie:

This is a  display differently

The question is: how do I remove the stuff just between sets of &start; and &end; pairs and make sure that it doesn't remove anything between any &end; and &start; segments?

Keep in mind, I'm working with hundreds of strings that are very different to each other so I'm looking for a flexible solution that'll work with all of them.

Thanks in advance for any help with this.

Edit: Replaced dollar signs with ampersands. Oops!

Try this regex /\&start;(.+?)\$end;/g

It looks like it works as desired: https://regex101.com/r/MW5nom/2

I quickly tried it on chrome console using JS, tried converting it into PHP:

"This is a &start;pretty bad$end; string that I want to &start;somehow$end; display differently".replace(/\&start;(.+?)\$end;/g, "")