Quantcast
Channel: Remove empty array elements - Stack Overflow
Viewing all articles
Browse latest Browse all 28

Answer by Shahrukh Anwar for Remove empty array elements

$
0
0

As per your method, you can just catch those elements in an another array and use that one like follows,

foreach($linksArray as $link){
   if(!empty($link)){
      $new_arr[] = $link
   }
}

print_r($new_arr);

Viewing all articles
Browse latest Browse all 28

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>