php string replace from right code example
Example 1: php replace string within string
$new_string = str_replace( $take_out, $put_in, $string);
Example 2: replace exact word in php
$string = preg_replace('/\bthe\b/', '', $string);
$new_string = str_replace( $take_out, $put_in, $string);
$string = preg_replace('/\bthe\b/', '', $string);