Machine Learning and Trend Analysis in PHP