I need to convert an array that is like
$data = array('Image','Thumbnail','size')
to
$data= array('Image'=>array('Thumbnail'=>array('size'=>'test')));
format.
How it will be possible?.
I had tried something like below.
$count= count($data);
$last = $count-1;
for($i=$count-2;$i>=0;$i--)
{
$newArray[$data[$i]][$data[$last]]='test';
$last=$i;
}
but it gives output as
Array(
[thumbnail] => Array
(
[type] => test
)
[image] => Array
(
[thumbnail] => test
))
Any help will be appreciated. Thank you :-)