Now that you have been introduced to the basic PHP data types, let's explore how these data types can be manipulated to perform calculations and more using PHP. As you would expect, PHP supports all the basic mathematical operations of any programming language, including addition and multiplication as well as a wide range of trigonometric and logarithmic functions. Beyond mathematical manipulations, PHP supports an even greater amount of string manipulation functions. This chapter will cover only the more fundamental variable manipulations used in both strings and mathematics.
Performing mathematical operations in PHP is a fairly intuitive task. PHP supports all the common mathematical standards for operator precedence, groupings, and so on for both integers and floating-point numbers.