I have lines that look like this:
John Miller-Doe - Name: jdoe Jane Smith - Name: jsmith Peter Piper - Name: ppiper Bob Mackey-O'Donnell - Name: bmackeyodonnell
I try to delete everything after the second hyphen, so I have left:
John Miller-Doe Jane Smith Peter Piper Bob Mackey-O'Donnell
So basically, I'm trying to find a way to chop it off right before "- Name:". I played with substr and preg_replace, but I canβt get the results that I hope for ... Can someone help?
string php replace
KarmaKarmaKarma
source share