[ Personal Stuff, Freebies, Blog, Portfolio, Store and Web Services ]

How to remove empty element or NULL values from PHP array?

Okay let say that we have the following array

In our array above we have an empty element which is [3], so how to get rid of it? will that’s not a problem I will explain it here.

After searching and digging on the net I found 4 to 10 lines of code but I believed that there should be a simple possible solution for this, then I tried searching over php.net site and I found this very useful php array function array_filter().

How to remove empty element or NULL values from array?

To remove NULL values

To remove all false values

That’s it and it works like a charm;)

Tagged with:
  • http://www.raybanoutletshop.com AstegeAlopsk

    Cast beyond the fish, bringing the bait back past it using a fast retrieve. http://www.lespiratesreunis.net
    ———————
    Mulberry uk outlet

  • http://www.guaranteedloanshq.co.uk/graduate-loans compare graduate loans

    This is actually a smart blog. I mean it. You’ve so much understanding about this issue, and so a lot passion. You also know the way to make men and women rally behind it, naturally from the responses. Youve got a design here thats not too flashy, but makes a statement as big as what youre saying. Great job, indeed.

  • http://www.raybanoutletshop.com AstegeAlopsk

    Eating a healthy, sensible diet can make slim arms much more attainable.
    visit this link