我想将当前路径信息保存在一个数组中,一个字段是另一个字段的一部分。我可以在初始化过程中访问同一个数组的字段吗?PHP可能初始数组来自同一个数组的值?
$this->path = array
(
'rel_image' => '/images',
'document_path' => '/a/file/path',
'path' => $this->path['document_path'].$this->path['rel_images']
);
还是我必须一个接一个地初始化它们?
函数调用?构造函数? – hakre
好吧,'array'是一个返回数组的函数。但它就像一个构造函数,它返回一个初始化对象。但它是......''阵列'是特别的。 – cwallenpoole