I'm working on config file which contain huge array, instead of assigning same value again and can I reuse which is already assigned to other index(or key) in the time of creating array? and here is my code
<?php
return [
//array
//array
//array
'ar' => [
'mainDirectory' => 'http://example.com/main/',
'subDirectory' => 'http://example.com/main/sub/',
// instead of using above can't I reuse which is already exist something like below
// 'subDirectory' => [ar.mainDirectory].'sub/'
]
//array
//array
//array
];
?>
I know we can access array & its index's after it is created and just for curiosity is there any way we can access it in the time of creating array itself?
Thank you