Introduction to PHP Call_user_func

Source: Internet
Author: User
Mixed Call_user_func (callback $function [, Mixed $parameter [, mixed $ ...])

A PHP function is passed with a function name string. Any built-in or user-defined functions can be passed in addition to the language structure such as array (), Echo (), Empty (), eval (), exit (), Isset (), list (), print (), and unset ().

An object's methods are passed as an array, the array's subscript 0 indicates the object name, and subscript 1 indicates the method name.

For static classes that are not instantiated as objects, to pass their methods, replace the object name indicated by the array 0 subscript with the name of the class.

In addition to normal user-defined functions, you can 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.