Hi everyone,
I have started getting my hands down and dirty with PHP, and I am kind of stuck with this one problem, which I really think is small, but has been annoying me for the past 20 minutes now. Basically, I decided to write out this small code where the user enters a number (in minutes) and then PHP will process and output the number in hours and minutes. EG: 62 Minutes is 1 hour and 2 minutes. (I have put up a testing version here if you want to see what I mean: http://testingsite.koeksworld.com/hms.php )
Here is the deal though, the code works, for all above 60 minutes. When the user enters a number under 60 minutes, lets say 54, it will return, 54 minutes is 1 hour and 54 minutes...this isn't correct obviously. I do know what I need to do here is to somehow trim away the decimal part of the number.... I tried number_format, and format() and int() and those haven't worked yet.
I been having so much fun with PHP then this shows up....can someone please give me a hint if not the answer??
Thanks a lot
I have started getting my hands down and dirty with PHP, and I am kind of stuck with this one problem, which I really think is small, but has been annoying me for the past 20 minutes now. Basically, I decided to write out this small code where the user enters a number (in minutes) and then PHP will process and output the number in hours and minutes. EG: 62 Minutes is 1 hour and 2 minutes. (I have put up a testing version here if you want to see what I mean: http://testingsite.koeksworld.com/hms.php )
Here is the deal though, the code works, for all above 60 minutes. When the user enters a number under 60 minutes, lets say 54, it will return, 54 minutes is 1 hour and 54 minutes...this isn't correct obviously. I do know what I need to do here is to somehow trim away the decimal part of the number.... I tried number_format, and format() and int() and those haven't worked yet.
I been having so much fun with PHP then this shows up....can someone please give me a hint if not the answer??
Thanks a lot