title: Remove empty array elements
body: <p>Some elements in my array are empty strings based on what the user has submitted. I need to remove those elements. I have this:</p>
  
  <pre><code>foreach($linksArray as $link)
  {
      if($link == '')
      {
          unset($link);
      }
  }
  print_r($linksArray);
  </code></pre>
  
  <p>But it doesn't work. <code>$linksArray</code> still has empty elements. I have also tried doing it with the <code>empty()</code> function, but the outcome is the same.</p>