functions.php — Built-in & User-defined Functions

Built-in Function

Message: Functions are reusable!

Length (strlen): 23

User-defined Function

Hello, Karanveer!

Explanation

Functions group steps so you can reuse them with different inputs. Built-in functions, like strlen(), ship with PHP and handle common tasks. User-defined functions let you name a block of logic and return results, which keeps code shorter, clearer, and easier to test.

Back to index