Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php pass function as callback


<?php

// An example callback function
function my_callback_function() {
    echo 'hello world!';
}

// An example callback method
class MyClass {
    static function myCallbackMethod() {
        echo 'Hello World!';
    }
}

// Type 1: Simple callback
call_user_func('my_callback_function');

// Type 2: Static class method call
call_user_func(array('MyClass', 'myCallbackMethod'));

Comment

PREVIOUS NEXT
Code Example
Php :: php check string 
Php :: php print 
Php :: What is the name of scripting engine in PHP? 
Php :: Laravel Excel check if column exists 
Php :: wherebetween laravel 
Php :: hint extension in visual studio code for laravel 
Php :: php artisan key:generate error 
Php :: PHP XML Expat Parser 
Php :: php-array-delete-by-value-not-key 
Php :: Merge Two Collection 
Php :: laravel best practices 
Php :: test_input php 
Php :: Spatie vendor publish 
Php :: PHP parse_str — Parses the string into variables 
Php :: how to get private images in s3 laravel 
Php :: model not found laravel 
Php :: reset admin password magento 2 
Php :: get from link php 
Php :: main.php 
Php :: laravel seeder update 
Php :: laravel relations find 
Php :: php read excel file 
Php :: php get constant value 
Php :: phpadmin 
Php :: php increment variable by 1 
Php :: Add Custom Field to woocommerce Subscriptions 
Php :: php artisan vendor:publish --provider="SpatieActivitylogActivitylogServiceProvider" --tag="activitylog-migrations" 
Php :: php pass byref 
Php :: compare in wp 
Php :: verify laravel string must be null 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =