title: How to correctly implement a inline if statement in a html tag?
body: <p>I want to have the checkbox seleted if the productNeedsAudit from the Json value is True.  But I new to php and I am also stuck implementing the logic with an echo statement.  I am trying the following:</p>
  
  <pre><code>echo "&lt;tr&gt;&lt;td&gt;&lt;div class='control-group controls'&gt;
            &lt;label for='productNeedsAudit'&gt;
                      &lt;input name='productNeedsAudit' type='checkbox'id='productNeedsAudit'  value='True'" . $soJson-&gt;{'productNeedsAudit'} == 'True' ? 'checked' : '' . "&gt;
                          Needs Audit
                 &lt;/label&gt; 
        &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;";
  </code></pre>
  
  <p>In the results, the check box isn't selected.  Instead,  I am getting the following in the web browser.</p>
  
  <pre><code>&gt; Needs Audit 
  </code></pre>
  
  <p>Here's the HTML</p>
  
  <pre><code>&lt;table&gt;
     &lt;tr&gt;
        &lt;td&gt;
           &lt;select style='width: 100%;' id='productType' name='productType'&gt;
              &lt;option value='TEST: TEST&lt;/option&gt;
           &lt;/select&gt;
        &lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
        &lt;td&gt;
           &lt;div class='control-group controls'&gt;
              &lt;label for='productDescription'&gt;Description: &lt;/label&gt;
              &lt;input type='text' name='productDescription' value='*.1stdibs.com, *.1stdibs.us.com' /&gt;
           &lt;/div&gt;
        &lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
        &lt;td&gt;
           &lt;div class='control-group controls'&gt;
              &lt;label for='productPriceBookDescription'&gt;Price Book Description: &lt;/label&gt;
              &lt;input type='text' id='priceBookDesc' name='productPriceBookDescription' style='width:100%' value='' /&gt;
           &lt;/div&gt;
        &lt;/td&gt;
     &lt;/tr&gt;
     /&gt;
     Needs Audit
     &lt;/label&gt; 
     &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
     &lt;tr&gt;
        &lt;td&gt;
           &lt;div class='control-group controls'&gt;
              &lt;label for='productServiceOrderNumber'&gt;Service Order: &lt;/label&gt;
              &lt;select  id='productServiceOrderNumber' name='productServiceOrderNumber'&gt;
                 &lt;option value='992769:53:14' selected='selected'&gt;992769:53:14&lt;/option&gt;
              &lt;/select&gt;
           &lt;/div&gt;
        &lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
        &lt;td&gt;
           &lt;input id='subcustomers' name='subcustomers'&gt;
           &lt;/input&gt;
           &lt;input id='subproducts' name='subproducts'&gt;
           &lt;/input&gt;
        &lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
        &lt;td&gt;
           &lt;input id='tags' name='tags'&gt;
           &lt;/input&gt;
        &lt;/td&gt;
     &lt;/tr&gt;
     &lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>