44 Views

18th April 2020

How to implement a callback in PHP?

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

Answers

8th July 2020

Answered by Swetha Shetty

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