function parsing of PHP common function processing

Source: Internet
Author: User
This article will explain the function parsing commonly used in PHP function processing.

func_get_arg-returns an item of a parameter list

func_get_args-returns an array containing a list of function arguments

func_num_args-returns the number of arguments passed to the function

call_user_func-call the first parameter as a callback function

Call_user_func_array-invokes the callback function and takes an array parameter as the parameter of the callback function

Forward_static_call_array-call a static method and pass the arguments as array

Forward_static_call-calls a static method and passes the arguments as an array

=========================================

One

Func_get_arg, Func_get_arg, func_num_argsclass test{public  function Hello ($a, $b, $c, $d) {   $num =func_num_args ();   echo "The number of method parameters is:". $num, "";   The third parameter of the IF (2<= $num) {    echo "method is:". Func_get_arg (2). ";     }   $num 2=func_get_args ();   for ($i =0; $i < $num; $i + +) {       echo {$i} parameters are {$num 2[$i]} "." ";}}      $T =new Test (); $T->hello (' A ', ' B ', ' C ', ' D ');//The number of method parameters is: the third parameter of the 4//method is: c//No. 0 parameter is a//1th parameter is b//2nd parameter is c//3rd parameter is D

This article will explain the function of PHP common function analysis, more relevant content please focus on PHP Chinese web.

Related Article

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.