Hi,
I've been trying to find a regex that will remove all the character from my string after a specified point.
$string="some_thing";
I would like to remove the "_" and everything after it.
The string will be of varying length but the cut off point will always be the "_" character.
How can I do this?
In addition if the string contained more than one instance of the "_" character, how could I get it to cut off at the first one?
Thank you.
I've been trying to find a regex that will remove all the character from my string after a specified point.
$string="some_thing";
I would like to remove the "_" and everything after it.
The string will be of varying length but the cut off point will always be the "_" character.
How can I do this?
In addition if the string contained more than one instance of the "_" character, how could I get it to cut off at the first one?
Thank you.