Comparing preg_replace and str_ireplace (Rude Word(s) Filter)

Filtering users input is unfortunately something that needs to be done these days. Possibly even more so when the content is coming from another website/service (such as twitter or facebook).  Swearing/rude words is quite a serious area, as you really don’t want to offend any visitors to your site by displaying a live thread showing comment or a ‘tweet’ or similar containing offensive langauge (tends to go down badly). So on this very note I set out today to add a live twitter feed to my current project (www.wsaf.co.uk), but decided once I had pulled the data from twitter I should probably remove any swearing before displaying it on the site!

As the site is written in php funnily enough this was also going to be. As I like to make my code as fast a possible I decided I would test the speed to different functions that could be used for this purpose:

preg_replace();
//and...
str_ireplace();

Continue reading

Latest Project!

So my current web dev related project is the 2010 WSAF website (Warwick Student Arts Festival – Massive student run arts festival, music, comedy, theatre, so name it. It’s there!) I did the site last year and I got the impression they quite liked it (http://old.wsaf.org.uk). So the new exec for WSAF this year asked me to do it again… Allbeit with some help this time around.

http://www.wsaf.co.uk

This year I have two computer science students to help out with the coding and two people who are very good at graphics to help with making the site look amazing! So all in all should turn out looking really really nice.