0 ? $hours . ':' : ''); $format .= ($hours > 0 && $minutes < 10 ? '0' : '') . $minutes . ':'; $format .= ($seconds < 10 ? '0' : '') . $seconds . ':'; $format .= ($milliseconds < 100 ? '0' : '') . ($milliseconds < 10 ? '0' : '') . $milliseconds; return $format; } /** * Formats the given time (seconds) to hh:mm:ss * * @param int $seconds * @return string */ public static function formatTimeH($seconds) { return gmdate("H:i:s", $seconds); } /** * Convert the given time (seconds) to mysql timestamp * * @param int $seconds * @return string */ public static function formatTimestamp($seconds) { return date("Y-m-d H:i:s", $seconds); } /** * Strip $codes from the string * * @param string $string * @return string */ public static function stripCodes($string) { $string = preg_replace('/(?