If I want to check 'php' exist in a string and delete the words after it I could just use:
$string = 'hello world php is a bla bla..';
$string = explode(' php ', $string);
echo $string[0];
But what if I have multiple words instead of just 'php'? For example few song name below has 'feats','feat','ft','ft.'.. that's four of them.
I want to make like 'sia - elastic feat brunos mars' become just 'sia - elastic'.
you can use
this will check for the first occurrence of the string 'php'.. and remove the rest after that.
This is the code that you need: