title: function delete_item() from array php
body: <p>Why this function does not work? After calling it, the same array is printed.</p>
  
  <pre><code>$myArray1 = ["Barcelona",  "Romania", "Cile", "France"];
  
  function del(&amp;$array, $item_to_del){
      foreach ($array as $item) {
          if ($item == $item_to_del){
              unset($item);
  
          }
      }
  }
  
  del($myArray1, "Barcelona");
  var_dump($myArray1);
  </code></pre>