PHP Functions

Example 1: Built-In Function - strtoupper()

Original text: hello from earth

Converted to uppercase: HELLO FROM EARTH

Example 2: User-Defined Function - myMessage()

There's still time to grill

Explanation

A function is a block of code that performs a specific task and can be reused whenever needed. "strtoupper()" is a built in function provided by PHP, so you just call it by name, it takes a string and returns it in all capital letter. A user defined function is one you write yourself to do whatever you need.