title: Remove specific keys from multidimensional array recursively
body: <p>I am trying to create a function to remove keys from a dynamic multidimensional array, i need to give:</p>
  
  <pre><code>removeByIndex(['hello', 'my', 'world']);
  </code></pre>
  
  <p>And then the function needs to do this:</p>
  
  <pre><code>unset($array['hello']['my']['world']);
  </code></pre>
  
  <p>The number of indexes are dynamic, example:</p>
  
  <pre><code>removeByIndex(['hello', 'my']); // Do: unset($array['hello']['my']);
  removeByIndex(['hello']); // Do: unset($array['hello']);
  </code></pre>
  
  <p>I tried to use some <code>foreach</code> loops, but i didn't find a solution yet.</p>
  
  <p>Any help will be welcome.</p>