Although in the next few pages we will lean how to write our own functions, PHP has several functions that already exist for us to use. Although they all have different uses, all functions are phrased as: name(argument). The name being the name of the function, and the argument being the value(s) it is using.
Here are some examples of functions already in PHP:
<?php $a = abs(-.43); $b = sqrt(16); $c = round(12.3); print "The absolute value of -.43 is " . $a . "<br>"; print "The square root of 16 is " . $b . "<br>"; print "12.3 rounded is " . $c . " and 12.5 rounded is " . round(12.5); ?>
This gives an example of three functions; absolute value, square root, and rounding. As you can see you can use the function right in the print statement or you can assign it to a variable. A list of functions can be found here.