Total money to be paid after traveling the given number of hours | PHP implementation of the above approach ; calculating hours travelled
< ? php $ m = 50 ; $ n = 5 ; $ x = 67 ; $ h = 2927 ; $ z = ( int ) ( ceil ( $ h / 60 ) ) ; if ( $ z <= $ n ) print ( $ z * $ m ) ; else print ( $ n * $ m + ( $ z - $ n ) * $ x ) ; ? >