<?php
function myround($value, $places=0) {
    if ($places < 0) { 
      $places = 0; 
    }
    
    $mult = pow(10, $places);
    
    $number1  =  $value * $mult;
    $number2  = intval($number1);
    $number3  = $number1 - $number2;

    if($number3 >= 0.5) {
      return ceil($value * $mult) / $mult;
    } else {
      return floor($value * $mult) / $mult;
    }
}
?>