1
2<?php
3
4// An example callback function
5function my_callback_function() {
6 echo 'hello world!';
7}
8
9// An example callback method
10class MyClass {
11 static function myCallbackMethod() {
12 echo 'Hello World!';
13 }
14}
15
16// Type 1: Simple callback
17call_user_func('my_callback_function');
18
19// Type 2: Static class method call
20call_user_func(array('MyClass', 'myCallbackMethod'));
21
22