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 \
$cuttedString = substr("your string", -7);
this should do the job.