engrlaravel
2 weeks ago

How to check if variable is empty/null/NULL/not set/0

Posted 2 weeks ago by engrlaravel

I know there are many ways like

empty($var)
is_null($var)
isset($var)
if(!$var)

But each one has different purpose. I want to have a combined function in laravel to check all these

Does laravel provide a single function to check all in one?

Need to check all possible like

NULL,null,'',0, undefined , not posted and others

Please sign in or create an account to participate in this conversation.