I'm trying to transform this:
http://link_brochure/1/2 OR link_brochure/1/2
into this:
class="show-brochure" href="http://localhost/main/brochure/1/2"
But I'm a rookie when it comes about regular expressions... Any ideas?
Thanks!
I'm trying to transform this:
http://link_brochure/1/2 OR link_brochure/1/2
into this:
class="show-brochure" href="http://localhost/main/brochure/1/2"
But I'm a rookie when it comes about regular expressions... Any ideas?
Thanks!
Something like this?
$str=preg_replace(
'{(?:http://)?link_brochure/(\d+)/(\d+)}',
'class="show-brochure" href="http://localhost/main/brochure/$1/$2"',
$str);
Edit: updated following question edit (Thanks Peter).