title: Comparing HTML Option value with php variable
body: <p>I've written this piece of code:</p>
  
  <pre><code>&lt;select name="account_type" id="account" class="form-control" required&gt;
      &lt;option value="Asset"&gt;Asset&lt;/option&gt;
      &lt;option value="Bank"&gt;Bank&lt;/option&gt;
      &lt;option value="Capital"&gt;Capital&lt;/option&gt;
      &lt;option value="Cash" &lt;?php if($_POST['Cash'] == $ledger_account){?&gt; selected &lt;?php }?&gt;&gt;Cash&lt;/option&gt;
      &lt;option value="Expense"&gt;Expense&lt;/option&gt;
      &lt;option value="Income"&gt;Income&lt;/option&gt;
      &lt;option value="Liability"&gt;Liability&lt;/option&gt;
      &lt;option value="Creditors"&gt;S. Creditors&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I got a value from different page, which is stored in $ledger_account. However, I want to see an option (for example, Cash) to be selected here when the page loaded if the option value matches with $ledger_account value. Please help me to identify what I've done wrong here.</p>