I want to get rid of a part of a PHP variable if it exists. But the difficulty is that this part contains a dynamic element (numbers), which are always different. And the part that remains is not always the same length in words.
$string = "This is example one 10(+) t/m 16 person";
$string = "This is also an example 12(+) t/m 44 person";
$string = "And this is the final example";
The desired results should be:
$string = "This is example one";
$string = "This is also an example";
$string = "And this is the final example";
So it needs to filter out the "*(+) t/m * person" and I need to do a lot of this, so a compact and a clear solution is desirable.