- } elseif (preg_match('/^(\d{0,2})\D(\d{1,2})$/', $str, $m)) {
- if ($m[1] < 24 and $m[2] < 60) {
- $str = sprintf('0:%02d:%02d:00', $m[1], $m[2]);
- } elseif ($m[1] == 24 and $m[2] == 0) {
- $str = '1:00:00:00';
- } else {
- return false;
+ elseif (preg_match('/^(\d{0,2})\D(\d{1,2})$/', $str, $m)) {
+ if ($m[1] < 24 and $m[2] < 60) {
+ $str = sprintf('0:%02d:%02d:00', $m[1], $m[2]);
+ }
+ elseif ($m[1] == 24 and $m[2] == 0) {
+ $str = '1:00:00:00';
+ }
+ else {
+ return false;
+ }
+ }
+ elseif (preg_match('/^(\d{0,2})\D(\d{1,2})\D(\d{1,2})$/', $str, $m)) {
+ if ($m[1] < 24 and $m[2] < 60 and $m[3] < 60) {
+ $str = sprintf('0:%02d:%02d:%02d', $m[1], $m[2], $m[3]);
+ }
+ elseif ($m[1] == 24 and $m[2] == 0 and $m[3] == 0) {
+ $str = '1:00:00:00';
+ }
+ else {
+ return false;
+ }