SyntaxFix
Write A Post
Hire A Developer
Questions
Austin's answer works for your example case.
More generally, you would do well to look into the regular expression functions when the substring you're splitting on may differ between strings:
$variable = preg_replace('/By.*/', '', $variable);