fork download
  1. <?php
  2. $num='000.00001000';
  3. if (is_float($num+0)) {
  4. $e=explode('.',rtrim($num,'0'));
  5. $num=number_format($num+0,strlen($e[1]));
  6. } else {
  7. $num=intval($num);
  8. }
  9. echo $num;
  10. ?>
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
0.00001