相关疑难解决方法(0)

命名PHP可选参数?

在PHP 4/5中是否可以在调用时指定一个命名的可选参数,跳过你不想指定的参数(比如在python中)?

就像是:

function foo($a,$b='', $c='') {
    // whatever
}


foo("hello", $c="bar"); // we want $b as the default, but specify $c
Run Code Online (Sandbox Code Playgroud)

谢谢

php default-value

21
推荐指数
3
解决办法
9224
查看次数

标签 统计

default-value ×1

php ×1