title: Advise on simplifying a PHP statement
body: <p>I am new to PHP and am coding a template file for a Joomla K2 item layout.</p>
  
  <p>I have an 'extra field' <code>$extrafields[15]</code> configured which outputs as "Yes", "No" or "". <code>$extrafields[16]</code> is a text string.</p>
  
  <p>I have this code, which works but would appriciate advice on how to simplify it, as I know it is probably a bit crude!</p>
  
  <pre><code>if (!empty($extrafields[15])): 
      if ($extrafields[15] == "Yes") {
          echo "&lt;span class=sgl-bold&gt;Sponsored by:&amp;nbsp;&lt;/span&gt;"; 
      }
  
      if ($extrafields[15] == "Yes"):
          if (!empty($extrafields[16])):
              echo $extrafields[16]; 
          endif;
          echo "&lt;br&gt;";
      endif;
  endif;
  </code></pre>