if_e

If then else oder einfacher

if(!empty(trim($position['description']))) {
  $myDescription = $position['description'];
} else $myDescription = '';

$myDescription = '';
if(!empty(trim($position['description']))) {
  $myDescription = $position['description'];
}

$myDescription = !empty(trim($position['description'])) ? $position['description'] : '';

Share this post

Share on facebook
Share on twitter
Share on pinterest
Share on email