PHP Functions

Built-In Function Example

My name has 17 characters.

User-Defined Function Example

Welcome to Activity 3, Lojain!

Explanation

Functions are reusable sections of code that perform a specific task. PHP provides built-in functions, such as strlen(), that are already available to programmers. Developers can also create their own user-defined functions. Functions help organize programs, reduce repeated code, and make it easier to perform the same task multiple times with different information.