How to get function's parameters names in PHP?

前端 未结 3 1881
情话喂你
情话喂你 2021-02-07 18:28

I\'m looking for a sort of reversed func_get_args(). I would like to find out how the parameters were named when function was defined. The reason for this is I don\

3条回答
  •  失恋的感觉
    2021-02-07 19:29

    While it's not impossible to do it, it's usually better to use another method. Here is a link to a similar question on SO :

    How to get a variable name as a string in PHP?

    What you could do is pass all your parameters inside of an object, instead of passing them one by one. I'm assuming you are doing this in relation to databases, you might want to read about ORMs.

提交回复
热议问题