title: Why is PHP printing my function as a string?
body: <p>I have the following method:</p>
  <pre><code>function display_first_headline_background_color_option_field() {
      $selectedOption = get_option('first_header_headline_background_color');
      echo '&lt;select name=&quot;first_header_headline_background_color&quot; id=&quot;first_header_headline_background_color&quot;&gt;
           &lt;option value=&quot;0&quot;&gt;Select A Color&lt;/option&gt;
           &lt;option value=&quot;blue&quot; '.selected( $selectedOption, &quot;blue&quot; ).'&gt;Blue&lt;/option&gt;
           &lt;option value=&quot;gray&quot; '.selected( $selectedOption, &quot;gray&quot; ).'&gt;Gray&lt;/option&gt;
           &lt;option value=&quot;orange&quot; '.selected( $selectedOption, &quot;orange&quot; ).'&gt;Orange&lt;/option&gt;
           &lt;option value=&quot;orange&quot; '.selected( $selectedOption, &quot;white&quot; ).'&gt;White&lt;/option&gt;
           &lt;option value=&quot;orange&quot; '.selected( $selectedOption, &quot;yellow&quot; ).'&gt;Yellow&lt;/option&gt;
           &lt;/select&gt;';
      }
  </code></pre>
  <p>That is printing the literal string <code>selected='selected'</code> before the <code>select</code> option shows on the page:</p>
  <p><a href="https://i.stack.imgur.com/GBy1l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GBy1l.png" alt="enter image description here" /></a></p>
  <p>How can I edit my function to stop this from happening?</p>
  <p>The <code>get_option</code> method is <a href="https://developer.wordpress.org/reference/functions/get_option/" rel="nofollow noreferrer">here</a> and the <code>selected</code> method is <a href="https://developer.wordpress.org/reference/functions/selected/" rel="nofollow noreferrer">here</a>.</p>