title: Smarty compare strings
body: <p>I am trying to compare to values in smarty:</p>
  
  <pre><code>{if $needle == '1'}
  // Whatever
  {else}
  // ..
  {/if}
  </code></pre>
  
  <p><code>$needle</code> has the value "0" (string). By calling the site, i never get into the "else" case. Somebody can tell me why?</p>
  
  <p>What i have tried so far:</p>
  
  <p><code>$needle</code> to INT Cast (by <code>$needle|intval</code>, <code>(int) $needle</code>, <code>$needle|string_format:"%d"</code>)
  Used <code>===</code> and <code>eq</code> Operator instead <code>==</code></p>