I find myself writing code very similar to this regularly, in PHP and in C#
print isset($required) ? ($required ? "required" : "not required") : "not required";
Feels like I should be able to do something like this
print falseornull($required) ? "not required" : "required"
I could write a function to do this for me in PHP or C#, but I'm wondering if something already exists in either language? In C# I know there's string.IsNullOrEmpty
to check for blank strings. Any equivalents for other types?