PHP string to multi level array
<p>How to convert this* string:</p>

<pre><code>$arrKeys = ['lev1', 'lev2', 'lev3'];
$val = 'foo';
</code></pre>

<p>In to the following array:</p>

<pre><code>Array
(
[lev1] =&gt; Array
    (
        [lev2] =&gt; Array
            (
                [lev3] =&gt; foo
            )

    )
)
</code></pre>

<p>*Number of array keys may vary. Each array key except the last one represents Array.</p>

<p>Thank you!</p>