xxxxxxxxxx
user defined Callback Functions:
A callback function is just nothing but called function, a function which has as an argument into another function.
To use a function as a callback function, pass a string containing the name of the function as the argument of another function:
Any existing function can be used as a callback function.
<?php
function CarDetails($car) {
return $car . "! ";
}
function printFormatted($car, $func) {
// Calling the $func callback function
echo $func($car);
}
// Pass "CarDetails" as callback functions to printFormatted()
printFormatted("Audi car", "CarDetails");
?>