Introduction to phpcall_user_func

Source: Internet
Author: User
Introduction to phpcall_user_func mixed call_user_func (callback $ function [, mixed $ parameter [, mixed $...])

A php function is passed using a function name string. Any built-in or user-defined functions can be passed, except for the language structures such as array (), echo (), empty (), eval (), exit (), isset (), list (), print (), and unset ().

The method of an object is transmitted as an array. the subscript 0 of the array indicates the object name, and subscript 1 indicates the method name.

For a static class that is not instantiated as an object, pass its method and replace the object name specified by the array 0 subscript with the name of this class.

In addition to common user-defined functions, you can also use create_function () to create an anonymous callback function (callback ).

 

  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.