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().
To remove NULL values
To remove all false values
That’s it and it works like a charm;)
0 comments:
Post a Comment