replace last seven characters of string
<p>I have a string and I want to replace the last 7 charators of the string with "#". For example I have "MerryChristmasu87yujh7" I want to replace "87yujh7" with seven "#######". So, the final string will be "MerryChristmasu#######".</p>

<p>I have tried the follow code but it returns "MerryChristmasu#######1". It does not convert all seven ending characters.</p>

<pre><code>$string = "MerryChristmasu87yujh7";
$match = substr($string, -7, -1);
$result = str_replace($match, "#######", $string);
</code></pre>
