Some elements in my array are empty strings based on what the user has submitted. I need to remove those elements. I have this:
foreach($linksArray as $link)
$my = ("0"=>" ","1"=>"5","2"=>"6","3"=>" "); foreach ($my as $key => $value) { if (is_null($value)) unset($my[$key]); } foreach ($my as $key => $value) { echo $key . ':' . $value . ''; }
output
1:5 2:6
1:5
2:6