I'm not a PHP guy so no idea so how to do it, but tried something as given below.
Requirement:
<link href="<?php the_permalink(); ?>">
Currently gives me this output:
<link href="http://example.com/au/">
I need to change a part of URL at runtime using regular expression or any string replace function.
Something like this:
<link href="<?php echo str_replace("/au/","/uk/","<?php the_permalink(); ?>"); ?>"/>
I thought this would work, but instead it gives me this:
<link href="http://example.com/uk/"/>
Please advise what would be the correct solution.