fork(5) download
  1. <?php
  2. function insertInPosition($str, $pos, $c){
  3. return substr($str, 0, $pos) . $c . substr($str, $pos);
  4. }
  5.  
  6. $str = "30000000";
  7. echo insertInPosition($str, 4, '.');
Success #stdin #stdout 0.01s 82560KB
stdin
Standard input is empty
stdout
3000.0000