I’ve been working on a little project to scrape and automatically tag a load of content, and I found I needed to convert some website addresses in some text content that weren’t linked with anchor tags.

I tried this routine which is replicated in a few places, but I’ve found that if a link ends with a full stop, it will include the full stop as part of the linked URL and break.

So stone me, it turns out that CodeIgniter -the PHP framework I’ve been using all along – has a function in its URL Helper called auto_link for this very purpose. And it handles any full stops at the end of the URL.

I must think of an appropriate way to celebrate – possibly I’ll fill the dishwasher.