Yes -- I'd definitely go with PHP, and do the heavy lifting in an external C program, communicating between the two with a pipe.