Function processing function in php

无忌哥哥
Release: 2023-04-01 21:00:02
Original
1237 people have browsed it

* Function processing function

* 1. Parameter acquisition: it must be called in a function to be meaningful

* 1.get_num_args(void): Return the number of parameters

* 2.get_get_args(): Returns the parameter value index array

* 3.get_get_arg(int): Returns the parameter value of the specified index

function demo1($a,$b,$c)
{
    //返回实际参数组成的索引数组
//    return func_get_args();//无参数,[0]=>php,[1]=>java,[2]=>c
//    return func_get_arg(1); //参数为实参索引,获取第2个参数值:java
    return func_num_args();//无参数,返回参数数量:3
}
print_r(demo1('php','java','c'));
Copy after login

The above is the detailed content of Function processing function in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template