How to Change Array a Special key to numeric in PHP
<p>I am using the following code to remove array, but I think there's a problem</p>

<p><a href="https://stackoverflow.com/questions/41013921/how-do-i-delete-a-specific-array-in-php/41022231#41022231">How do I delete a specific array in php</a></p>

<pre><code> array(2) {
  [7]=&gt;array(3) {
    ["title"]=&gt;string(3) "ads"
    ["number"]=&gt;int(3)
    [1]=&gt;array(2) {
      ["address-image"]=&gt;string(63) "http://localhost/wordpress/wp-content/uploads/2017/08/120-3.jpg"
      ["expire"]=&gt;string(10) "2017/03/10"
    }
    [2]=&gt;array(2) {
      ["address-image"]=&gt;string(63) "http://localhost/wordpress/wp-content/uploads/2016/09/240.jpg"
      ["expire"]=&gt;string(10) "2016/10/20"
    }
    [3]=&gt;array(2) {
      ["address-image"]=&gt;string(63) "http://localhost/wordpress/wp-content/uploads/2016/10/300.jpg"
      ["expire"]=&gt;string(10) "2016/12/28"
    }
  }
  ["_multiwidget"]=&gt;int(1)
}
</code></pre>

<p>After the run:</p>

<pre><code>array(2) {
  [7]=&gt;array(2) {
    ["title"]=&gt;string(3) "ads"
    ["number"]=&gt;int(2)
    [1]=&gt;array(2) {
      ["address-image"]=&gt;string(63) "http://localhost/wordpress/wp-content/uploads/2017/08/120-3.jpg"
      ["expire"]=&gt;string(10) "2017/03/10"
    }
    [3]=&gt;array(2) {
      ["address-image"]=&gt;string(63) "http://localhost/wordpress/wp-content/uploads/2016/10/300.jpg"
      ["expire"]=&gt;string(10) "2016/12/28"
    }
  }
  ["_multiwidget"]=&gt;int(1)
}
</code></pre>

<p>But I want to be changed later be removed as follows (Key changes from [3] to [2]):</p>

<pre><code>array(2) {
  [7]=&gt;array(2) {
    ["title"]=&gt;string(3) "ads"
    ["number"]=&gt;int(2)
    [1]=&gt;array(2) {
      ["address-image"]=&gt;string(63) "http://localhost/wordpress/wp-content/uploads/2017/08/120-3.jpg"
      ["expire"]=&gt;string(10) "2017/03/10"
    }
    [2]=&gt;array(2) {
      ["address-image"]=&gt;string(63) "http://localhost/wordpress/wp-content/uploads/2016/10/300.jpg"
      ["expire"]=&gt;string(10) "2016/12/28"
    }
  }
  ["_multiwidget"]=&gt;int(1)
}
</code></pre>

<p>Sorry, my English is not very good</p>

<p>Thank you</p>