How to reffer dynamically to a php ARRAY variable(s)?

前端 未结 3 1703
执念已碎
执念已碎 2021-01-23 01:52

Everybody knows that you can access a variable in PHP using this: ${\'varName\'}. But when you need to get/set a variable witch is part of an array, why doesn\'t it work ? Suppo

3条回答
  •  迷失自我
    2021-01-23 02:53

    Shouldn't it work ?

    No.

    Everybody knows that you can access a variable in PHP using this: ${'varName'}.

    Yes. Yet everybody knows that's lame.

    How to refer dynamically to a php array variable(s)?

    having array of ('my1','my11','my111') you can refer to any particular array member using merely a loop.

提交回复
热议问题