title: need help in PHP number format
body: <p>Hello everyone i am trying to format the input number range with php number_format</p>
  
  <h2>INPUT Probability</h2>
  
  <ol>
  <li>1234</li>
  <li>12345</li>
  <li>123456789</li>
  <li>123456789,50</li>
  <li>123.45,00</li>
  <li>123.456.78,50</li>
  </ol>
  
  <h2>OUTPUT should be</h2>
  
  <p>dot should be in multiplier of 3 digit and last two (if available in input range) digits should be come with comma separater</p>
  
  <ol>
  <li>1.234,00</li>
  <li>12.345,00</li>
  <li>123.456.789,00</li>
  <li>123.456.789,50</li>
  <li>12.345,00</li>
  <li>12.345.678,50</li>
  </ol>
  
  <p>out put should be as per dutch format and dot should be in multiplier of 3 digit and last two digits should be come with comma separater</p>
  
  <p>like, here is link you can <a href="http://www.schulden-insolvenzberatung.de/wissenswertes/pfaendungsrechner/" rel="nofollow">put any input value from above list in textbox </a> you can get output like shown below</p>
  
  <p>the code which i am using </p>
  
  <pre><code>echo numberFormat('12345');
  
  function numberFormat($num)
  {
       return preg_replace("/(?&lt;=\d)(?=(\d{3})+(?!\d))/",".",$num);
  }
  </code></pre>
  
  <p>but it will not work with (4),(5),(6) from my input probability to match with outputs.</p>