Easy Tutorial
❮ Func Math Expm1 Func Xml Utf8 Decode ❯

PHP FILTER_CALLBACK Filter



Definition and Usage

The FILTER_CALLBACK filter calls a user-defined function to filter data.

This filter provides us with complete control over data filtering.

The specified function must be stored in an associative array named "options". See the example below.


Tips and Notes

Tip: You can create your own function or use existing PHP functions.


Example 1

Using a user-defined function:

The output of the code is as follows:


Example 2

Using an existing PHP function:

The output of the code is as follows:


❮ Func Math Expm1 Func Xml Utf8 Decode ❯