title: How do I format a number to a dollar amount in PHP
body: <p>How do you convert a number to a string showing dollars and cents?</p>
  
  <pre><code>eg:
  123.45    =&gt; '$123.45'
  123.456   =&gt; '$123.46'
  123       =&gt; '$123.00'
  .13       =&gt; '$0.13'
  .1        =&gt; '$0.10'
  0         =&gt; '$0.00'
  </code></pre>