echo substr($string, 0, -2);
$start_time = '1030'; $pattern = '/(?<=dd)30/'; $start_time = preg_replace($pattern, '50', $start_time); //result: 1050