PHP Functions

Built-in Function Example

The text is: Sharmin Islam

The length of the text is: 13 characters.

User-Defined Function Example

Hello, Sharmin! Welcome to INFOST 440.

Explanation

Functions are reusable blocks of code that perform a specific task. PHP includes built-in functions such as strlen(), which counts the number of characters in a string. Users can also create their own functions to perform custom tasks. Functions help organize code and reduce repetition.

Back to Activity 3