Happy Pixels

Florian Loretan's blog on Drupal, creativity and more

regular expressions

I love music, I love making music and I love listening to music, but I always hate the question "what do you listen to?" I don't want to answer with the elitist "I listen to bands that don't even exist yet", but I still feel like there is more to it than just "Indie/Alternative Rock". I tried getting statistics from my last.fm account into wordle to see how I can express this visually. The result is interesting and looks pretty cool, here's how I did it.

The problem: you need to turn the values of an HTML select element into a PHP array, and you don't want to do it by hand because it has a lot of entries.

The solution: regular expressions! (using Eclipse's regex search/replace).

Subscribe to regular expressions