title: Is there a PHP function equivalent to JavaScript function toLocaleString()
body: <p>I was looking for a pre-built number formatting function and came across this JS function <code>toLocaleString()</code>. This function does exactly what I want it to do. </p>
  
  <p>For example, I have a number which I want to be formatted, let's say <code>1234567890.123</code>. I want this number to be formatted into <code>1,23,45,67,890.123</code> &amp; <code>1,234,567,890.123</code>.</p>
  
  <p>With the JS function I did it like this and got the desired output</p>
  
  <pre><code>var number = 1234567890.123;
  number.toLocaleString('hi-IN'); //1,23,45,67,890.123
  number.toLocaleString('en'); //1,234,567,890.123
  </code></pre>
  
  <p>However, I wanted to know if there is a built in method to do this with PHP.</p>
  
  <blockquote>
    <p>NOTE: money_format() is not what I'm looking for and I just want to
    know if there exists such a function in PHP too. If not, no problem,
    I'll have to write a custom function.</p>
  </blockquote>