A cool helper function to check if anything is blank in PHP

1 · Amit Merchant · Sept. 9, 2021, 6:21 a.m.
There are a lot of different ways in PHP using which you can validate if the given value is “blank” or not. The method to validate depends upon the type of value that we’re targetting. So, for instance, let’s say if you want to check if the value is null, you would use the is_null function of PHP. If you want to check if the given string is empty, you would use the combination of the is_string and trim functions to validate this scenario. Similarly for numeric and boolean values. But what if you...