PHP Functions

Built-in Function Example

The text is: Hello World

The length of the text is: 11

User-Defined Function Example

Hello Isaac!

Explanation

Functions are blocks of code that perform a specific task. PHP has built-in functions that are already included with the language. Programmers can also create their own functions. A function can receive information, perform an action, and return a result. Functions help avoid repeating the same code multiple times.

Back to Start