PHP Functions

Built-in Function Example

The text has 10 characters.

User-Defined Function Example

Hello, Alex!

Explanation

A function is a reusable block of code that performs a task. PHP includes built-in functions, such as strlen(), that are already available to use. A programmer can also create a user-defined function. A function can accept information as parameters and can return a result when it is called.

Back to Activity 3