What is the good example of using 'func_get_arg' in PHP?

后端 未结 7 1156
梦谈多话
梦谈多话 2021-02-07 00:39

I just have found out that there is a function called func_get_arg in PHP which enables developer to use variant style of getting arguments. It seems to be very us

7条回答
  •  离开以前
    2021-02-07 01:13

    Personally, I don't think there is a good use case for it inside a normal function. As a control freak I like to know exactly what is being passed to my functions and I like to know exactly what I'm passing.

    However, it can be use full for things like Dynamic/Static URL routing. When you are rewriting (via mod_rewrite) the URL args to a single bootstrap.

    In this sense, you can have arguments that don't necessarily need to exist with every page request.

提交回复
热议问题