I am not very good with php I have the following line
$totaltime = $hours . ':' . $minutes;
This sounds like what you are looking for:
$totaltime = $hours . ' hours ' . $minutes . ' minutes';
With apologies if you already know the following -
$ indicates variables - there are three variables - $totaltime, $hours and $minutes.
. is the concatenation operator, which adds the strings together.
Every line must end with a semicolon ;.
Strings may be encapsulated with single or double quotes. If you use single quotes, you will get exactly what you see. If you use double quotes, you may embed variables.