PHP: Self-referencing array

后端 未结 2 1089
广开言路
广开言路 2020-12-01 08:53

Is there a way of referencing an array key from within the array? This may make more sense in code format:

$array=array(
  \"Key1\"=>array(
    \"Value1\"         


        
2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 09:29

    Impossible to make it in one block, because you not initialized the variable yet. Same with class variables. To do such thing, you will need to create any variable any way, and than use its links only, but its using memory, so once again, real answer to your question is - impossible :)

提交回复
热议问题