I do not understand what this code is doing in PHP
<p>I have this code,</p>

<pre><code>// TEMP VAR
$temp = &amp;$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 = &amp;$temp[$directory];
}
</code></pre>

<p>I got it from the answer to this question,</p>

<p><a href="http://stackoverflow.com/questions/8537148/string-with-array-structure-to-array">String with array structure to Array</a></p>

<p>I know what it does, but not how it does it, could anyone please explain to me line by line what is happening?</p>

<p>Thank you all.</p>
