I want to change these links dynamically
from
mysite.com/some-link-here-t123.html
mysite.com/some-link-here-t456.html
mysite.com/some-link-here-t789.html
to
mysite.com/some-link-here-tid123.html
mysite.com/some-link-here-tid456.html
mysite.com/some-link-here-tid789.html
I tried using below
<?php
$string2 = preg_replace('/-t([^0-9.html]*)/','-tid$1',$string);
?>
but its messing up all the other words starts from -t like -table becomes -tidable
how to fix this?
.htmlinside the character group? And why do you negate the group with^at the beginning?