I have this code,
// TEMP VAR
$temp = &$files;
// BUILD ARRAY STRUCTURE
while(count($file['path'])) {
// GET DIRECTORY
$directory = array_shift($file['path']);
// DIRECTORY NOT SET
if(!isset($temp[$directory])) {
// SET DIRECTORY
$temp[$directory] = array();
}
// GO INTO ARRAYS NEXT DIRECTORY
$temp = &$temp[$directory];
}
I got it from the answer to this question,
String with array structure to Array
I know what it does, but not how it does it, could anyone please explain to me line by line what is happening?
Thank you all.