Function Examples

An example of the built-in function, echo:

Hello, world!

An example of a user-defined function, petName:

Sprinkles Eggert.
Fluff Eggert.
Teal Eggert.
Olivia Eggert.
Fawna Eggert.
Rambo Eggert.
Annabella Eggert.

An explanation of how functions work:

The concept of a function can be defined as a block of statements that can be repeated within a program. Programming complex tasks is easier with functions. PHP has a number of built-in functions for the purpose of creating dynamic websites with php sending data to the browser. User-defined functions are created by the user.