I’m looking for a way to turn something like
[url=http://www.example.com/]Example link[/url] [url=http://www.example.com/]Example link2[/url]
into
<a href="http://www.example.com/" id="link1">Example link</a><a href="http://www.example.com/" id="link2">Example link2</a>
Is there a way to get the number of times preg_replace has replaced while it’s running?