I have url like below
/test/(?<name>\w+)/(?<id>\d+)/
I want to replace it using preg_replace() function like this
/test/name/(?<id>\d+)/
I tried this but it does not work as i expected.
$subject = '/test/(?<name>\w+)/(?<id>\d+)/';
preg_replace('#\(.*\<name\>.*\)#', 'name', $subject);