Home > Web Development > On Another, Unrelated Note…

On Another, Unrelated Note…

November 11th, 2009 Leave a comment Go to comments

Go check out http://www.wtsr.org/! I just finished writing a little script to give them the “On Now” block in the right column. It’s a simple PHP script that parses a .csv file and does a few checks to determine day and current time.

I tried using file(), but it didn’t like the file, for whatever reason. Probably because it was using \r instead of \n for newlines. Oh well. So, I had to do a character-by-character parse (until I realized I could use a regular expression…) to get it implemented. Here are the two loops I ran. I’m sure it could be written more efficiently (like, checking during the first loop for everything, instead of just Day). How would everyone else write this?

Categories: Web Development Tags:
  1. November 11th, 2009 at 13:27 | #1
  2. November 11th, 2009 at 13:35 | #2

    Interesting. That would definitely help cut down the loops. I was looking for something like that, but I guess I just skimmed past it as I was looking for it. Thanks!

  3. James!
    November 11th, 2009 at 18:20 | #3

    I don’t see any HTML in that at all. Where are your and ‘s? I give your code a fail for a lack of dynamic text and flashing pictures.

  1. No trackbacks yet.