Remove empty array elements

Soimunk

New Member
Some elements in my array are empty based on what the user has entered. I need to remove these elements. This is my code to do so:\[code\]// Remove empty elementsforeach($linksArray as $link){ if($links == '') { unset($link); }}print_r($linksArray);\[/code\]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.Any help is appreciated, thanks.
 
Back
Top