PHP заменить строку внутри строки
$new_string = str_replace( $take_out, $put_in, $string);
Poised Penguin
$new_string = str_replace( $take_out, $put_in, $string);
$string = preg_replace('/\bthe\b/', '', $string);