Basically this whole time stuff is frustrating me, I am new to programming so I do apologise if I am asking a stupid question.
I have a MySQL time() stored in my databas
Strtotime is propagating a date inside there, something like "6PM today", instead of 6 hours like you intend. The easiest way to do this is to run
time() + (6 * 3600);
Where 6 is hours, and 3600 is the number of seconds in each hour.
strtotime
converts it to a unix time stamp. It DOES NOT represent six hours. It represents 6AM today. You should work with seconds:
$duration = '06:00:00';
$duration_array = explode(':', $duration);
$length = ((int)$duration_array[0] * 3600) + ((int)$duration_array[1] * 60) + (int)$duration_array[2];
$target = $length + time();
I'm not too familiar with mySql, but perhaps you can try
$target = strtotime($length) + time();