I need to determine which programming language is used in the code snippet, is there a library for this?
I already read this Detection of a programming language from a fragment , but I rather use the tested and working library.
The link you posted is exactly what you need. This is just a couple of hours of programming time. Otherwise, try googling for "Bayesian php spam filtering" - the first result might be what you are looking for: http://www.phpclasses.org/browse/package/4236.html