This ststs extension for PHP provides few dozens routines for statistical computation. WWW: http://pecl.php.net/package/stats/