How can PHP be used to split time values from seconds into hours, minutes, and seconds?

To split time values from seconds into hours, minutes, and seconds in PHP, you can use the `gmdate()` function along with some basic arithmetic operations. First, calculate the hours by dividing the total seconds by 3600, then calculate the remaining seconds after calculating the hours. Next, calculate the minutes by dividing the remaining seconds by 60, and finally, calculate the remaining seconds as the modulus of 60.

$totalSeconds = 3665; // Example total seconds

$hours = floor($totalSeconds / 3600);
$remainingSeconds = $totalSeconds % 3600;
$minutes = floor($remainingSeconds / 60);
$seconds = $remainingSeconds % 60;

echo "Hours: $hours, Minutes: $minutes, Seconds: $seconds";