XF 2.2 Conditional Statement for empty values?

John917

Active member
Some have values of null but for empty values like
1696989941195.webp

Is there a way to have a conditional statement to show something when filters are unset? And then show something else when filters are set.

I was hoping something like
$filters == [] (doesn't work)

I looked at trying some "inarray" but I am stuck.
 
If you are just looking to see if filters is null or an empty array, a simple not operator would work...
PHP:
!$filters

If you want to check if it's an array but not null:
PHP:
!$filter && is_array($filter)

A lot of different ways you can do it, just depends on how "loose" you want to be with the logic.
 
If you are just looking to see if filters is null or an empty array, a simple not operator would work...
PHP:
!$filters

If you want to check if it's an array but not null:
PHP:
!$filter && is_array($filter)

A lot of different ways you can do it, just depends on how "loose" you want to be with the logic.
Thank you digitalpoint!
 
Back
Top Bottom