Normally when I retrieve an array from the database, I check to see if a certain element exists or is set to a certain value and echo text out accordingly:
if (isset($bar)) // or is true
{
echo "something";
}
else // elseif is set to false
{
echo "not something";
}
But once you lots of variables, it can make your code quite an eyesore. I know you can easily create a function to do this, but does php provide an functionality built in to do this? What do fellow SOs do to get around this?
I find the ternary operator to be less of an eye-sore in these situations.
So