I've never found a single library that encapsulates different analysis patterns. You may find specific solutions easily though.
N-Gram analysis for example can be done with this PHP extension: http://pecl.php.net/package/TextCat
There are several bayes implementations as well, even tutorials.
I've never found Kohonen-nets or self-organizing maps implemented in PHP, but multi-layer perceptrons are trivial. IA can do pattern analysis fairily well.
There are projects that bind PHP to OpenCV (a library for realtime image/video analysis). Currently, the only implementation I know is for detecting human faces in pictures. The source is open https://github.com/infusion/PHP-Facedetect, so it should be easy to bind other OpenCV goodness (OpenCV can do a lot of stuff with images).
PHP itself is interpreted, most heavy solutions for pattern analysis won't perform well under this limitation. This is why most solutions for this in PHP are written in C as an extension.