Using the Built-in Function: strlen()

The length of the string 'Hello, PHP!' is: 11 characters.

Using a User-Defined Function: calculateArea()

The area of a rectangle with length 10 and width 5 is: 50 square units.

Functions in PHP

How Functions Work in PHP

Functions perform specific tasks. There are user-defined and built-in functions in php. User-defined are functions created by the coder themselves whereas built-in functions are already coded or in the script.