Quick PHP port of JS parse_reqs, still needs commenting

Not thoroughly tested, but should be exactly the same as the [original JS](http://hxhl95.github.io/media/course-visualizer/course_info.js).

I'll comment the code in a few days if I find time :) In the meantime, apologies for the messy and uncommented code.