wordpress check if custom field empty inside an echo statement


Staff member
Trying to edit a wordpress theme, where in a widget code echo statement i want to check if custom field empty show tag otherwise don't show it. Can any one help

At the moment its running
if($theI <= $count) {
echo '
<span class="beds">'.get_post_meta($p_id, 'bedrooms', true).'</span>

I want the span tag to show <strong>ONLY</strong> if bedrooms custom field is <strong>NOT empty</strong>, dont know how to add if/else statement inside an echo statement. So any help would be greatly appreciated