<?php
function insertInPosition($str, $pos, $c){
    return substr($str, 0, $pos) . $c . substr($str, $pos);
}

$str = "30000000";
echo insertInPosition($str, 4, '.');