PHP: Check if PID is running

I needed to write a small function, that can check if a specific PID is running an linux/unix system.

Check it out on Gist: https://gist.github.com/3096556