trim string after_ code example
Example: php remove after character
$s = 'Posted On April 6th By Some Dude';
echo strstr($s, 'By', true); // Posted On April 6th
$s = 'Posted On April 6th By Some Dude';
echo strstr($s, 'By', true); // Posted On April 6th