PHP Functions

Built-in Function Example

Original text: hello world

Using strtoupper(): HELLO WORLD

User-Defined Function Example

Hello, Hajar! Welcome to my PHP page.

Explanation

Functions are blocks of code that perform a specific task and can be used when needed. PHP has built-in functions, such as strtoupper(), that are already available to use. We can also create our own functions for specific tasks. Functions help organize code and prevent us from repeating the same code multiple times.

Back to Activity 3