0

I am not very good with php I have the following line

    $totaltime = $hours . ':' . $minutes;   

Where the ':' appears I would like to have a hours I tried ' hours ' and it shows up in the front end fine, but I would also likes to add "minutes" Currently shows as 00 hours 00 I would to add minutes to the last 00

ryanb4614
  • 153
  • 3
  • 16

1 Answers1

3

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.

user2182349
  • 9,569
  • 3
  • 29
  • 41