title: How to delete an item into an array with a button
body: <p>I have a code with an array that saves what i need each time I press a button, so these items saved into an array I showed later with a erase buttons, but I don't know how to delete it, so there is the part of the code that shows what I meant:</p>
  <pre><code>echo &quot;&lt;table border=1&gt;&quot;;
      echo &quot;&lt;tr class='tabPreciosTitles'&gt;&quot;;
        echo &quot;&lt;td&gt;Nom Activitat&lt;/td&gt;
              &lt;td&gt;Nom Tipus Activitat&lt;/td&gt;
              &lt;td&gt;Tipus Tarifa&lt;/td&gt;
              &lt;td&gt;Temps/km&lt;/td&gt;
              &lt;td&gt;Preu&lt;/td&gt;&quot;;
      echo &quot;&lt;/tr&gt;&quot;;
  for ($x=0;$x&lt;count($savedArray[4]);$x++){
    echo &quot;&lt;tr&gt;&quot;;
    echo &quot;  &lt;td&gt;&quot;.$savedArray[0][$x].&quot;&lt;/td&gt;&quot;;
    echo &quot;  &lt;td&gt;&quot;.$savedArray[1][$x].&quot;&lt;/td&gt;&quot;;
    echo &quot;  &lt;td&gt;&quot;.$savedArray[2][$x].&quot;&lt;/td&gt;&quot;;
    echo &quot;  &lt;td&gt;&quot;.$savedArray[3][$x].&quot;&lt;/td&gt;&quot;;
    echo &quot;  &lt;td&gt;&quot;.$savedArray[4][$x].&quot;&lt;/td&gt;&quot;;
    echo &quot;  &lt;td&gt;&lt;input type='submit' onclick='eliminar(&quot;.$savedArray[0][$x].&quot;,&quot;.$savedArray[1][$x].&quot;,&quot;.$savedArray[2][$x].&quot;,&quot;.$savedArray[3][$x].&quot;,&quot;.$savedArray[4][$x].&quot;)' class='carritoElim' value='elim'&gt;&lt;/td&gt;&quot;;
    echo &quot;&lt;/tr&gt;&quot;;
  }
  </code></pre>
  <p>a pic with all the forms:</p>
  <p><img src="https://i.stack.imgur.com/4dprn.jpg" alt="enter image description here" /></p>
  <p>the other pic that shows the items on the array:</p>
  <p><img src="https://i.stack.imgur.com/im5LO.jpg" alt="enter image description here" /></p>
  <p>Anyone knows how to delete the selected row that references the item on the array with the delete button? Thanks</p>