I want to save current path information in an Array and one field is a part of another. Can I access a field of the same array during initialization?
$this->path = array
(
'rel_image' => '/images',
'document_path' => '/a/file/path',
'path' => $this->path['document_path'].$this->path['rel_images']
);
or do I have to initial them one by one?
The array still is undefined while you’re defining it. However you can define other (temporary) variables to do so on the fly:
However that normally should not be needed, as you’re duplicating data within the array. Just saying, you can do whatever you want 🙂