Need an easy if (empty) php code

I am using a bit of php to grab title tags on specific pages depending on what users homepage they are currently on. I am far from a pro php coder. What I came up with was this.

<title>
    <?php $member = get_user(); ?>
    <? wp_title(' | ', 'echo', 'right'); echo $member->member_title; ?>
</title>

This is currently working but I would like to have a fail-safe in case its left blank. Can anyone help me with a quick if (empty) for this?

Related posts

Leave a Reply

2 comments

  1. <?php $member = getUser();?>
    <?php if(!empty($member->member_title)): ?>
        <title><? wp_title(' | ', 'echo', 'right'); echo $member->member_title; ?></title>
    <?php endif;?>