I have a PHP str_replace that replaces every hyphen - that comes right after a slash / by a non-breaking hyphen ̩.
str_replace( '/-', '/‑', $input );
I’d like to extend this str_replace with a second condition that says that also every hyphen that comes before a slash should also be replaced:
str_replace( '-/', '‑/', $input );
How can I merge these to conditions?