The R programming language is designed for statistical analysis, graphics, and reporting; and provides provides a wide variety of statistical (linear and nonlinear modelling, classical statistical tests, time-series analysis, classification, clustering), tools for data analysis, and graphical techniques. Designed specifically for that purpose, it provides a more sophisticated set of functions for mathematics and statistics than a more general purpose programming language like PHP. But if we need those mathematical or statistical features within our PHP code, we can integrate the two languages; using the power of R from within our PHP scripts. How do we set about doing so? Let's find out.