Gulshan Gulshan -4 years ago 106
PHP Question

Php multiply price with total hours

I have to multiple total no of hours (like 13:15) with price like(500).



How can i multiple total no of hours with price to get final price??

Answer Source

Something like this:


    list($h, $m) = explode(':',$hours);  //Split up string into hours/minutes
    $decimal = $m/60;  //get minutes as decimal
    $hoursAsDecimal = $h+$decimal;


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download