Post

PythonPython

A
Anand Sahu

Posted on 18th April 2024|68 views

0
votes

How to implement a callback in PHP?

Can someone help me out how to implement callback function in php ?

Answers
P
Swetha Shetty

Posted on 18th April 2024

In PHP, callback means a function object or reference, including type callable. A callback or callable variable can work as a function, an object method also a static class method.

Here is an example:

<?php

  function myFunction() {

    echo "mindmajix \n";

}

  call_user_func('myFunction');

?>

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo
  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos