title: How to subtract value of array but still in position
body: <p>How can I subtract the value of an array if that value is greater than specific data?</p>
  <p>For example:</p>
  <p>I have an array of menu's position <code>[0,3,10,5,6,9,2,7,1,4,8,11]</code> I want to subtract all values that are greater than <code>selectedDeletedNumbers</code> and stay in their position.</p>
  <p>Example: If I delete <code>3</code> and <code>5</code>. <em>I am using checkbox to delete</em></p>
  <p>And the output should be like this.</p>
  <p><code>[0,8,4,7,2,5,1,3,6,9]</code></p>
  <p>Greater than <code>3</code> is subtract by <code>1</code>, and greater than <code>5</code> is subtract by <code>2</code> since I selected <code>2</code> numbers.</p>
  <p>HTML</p>
  <pre><code>@foreach ($columns as $key =&gt; $column)
      &lt;div class=&quot;checkbox checkbox-danger col-xs-6 el{{ $column-&gt;Field  }}&quot;&gt;
          &lt;input type=&quot;checkbox&quot; name=&quot;CheckboxDelete[]&quot; id=&quot;check{{ $column-&gt;Field  }}&quot; data-column=&quot;{{ $key }}&quot; value=&quot;{{ $column-&gt;Field }}&quot;&gt;
          &lt;label for=&quot;check{{ $column-&gt;Field  }}&quot;&gt;&lt;b style=&quot;color: grey&quot;&gt;{{ strtoupper($column-&gt;Field) }}&lt;/b&gt;&lt;/label&gt;
      &lt;/div&gt;
  @endforeach
  </code></pre>
  <p>Here is my code, but it's only when deleted 1, and not in a position as well.</p>
  <pre><code>$searchArr = array_search( $selectedDeletedNumbers, $items);
  unset($items[$searchArr]);
  $numbers = [];
  foreach ($items as $item) {
      if ($item &gt; $col[1])
          $numbers[] = $item - 1;  
  }
  </code></pre>
  <p>Thanks in advance.</p>