Gulshan Gulshan -4 years ago 98
PHP Question

Php mulltiply 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??

This question is not related to duplicated question tag. i have to multiple hours with price..and related question is converting hours into minutes.

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