I'm trying to figure out how I can trim a string variable, say $id so that instead of just trimming it by the "first 3 letters" or whatever, it trims it based on "so-and-so character, and on"
So basically I have strings like "ff7/stuff" and I want it to recognize the "/" and trim it and everything beyond that, so im left with "ff7"
I can't use substr($id, 0, 3); because the first part isnt always 3 characters. Any idea on a simple solution to this? or can it only be done in a complicated way.