LMSouq
php-dev Open

Remove empty array elements

WI
Will
1 month ago
3 views
Problem Description
Some elements in my array are empty strings from users. `$linksArray` still has empty elements after the following: foreach($linksArray as $link) { if($link == '') { unset($link); } } print_r($linksArray); The `empty()` function doesn't work either.

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base