草庐IT

getAllForms

全部标签

php - 函数中的多个可选参数

getAllForms($data=null)getAllForms()andgetAllForms("data")这会起作用。但是我想在这样的函数中创建两个可选参数:getAllForms($arg1=null,$arg2=null)getAllForms()andgetAllForms("data")我怎样才能做到这一点? 最佳答案 你可以试试:functiongetAllForms(){extract(func_get_args(),EXTR_PREFIX_ALL,"data");}getAllForms();getAllFo