示例#1
0
 public static function stringToTimeList($string)
 {
     $list = [];
     $times = split("([,; \n]+)", $string);
     for ($i = 0, $size = count($times); $i < $size; ++$i) {
         $time = mb_ereg_replace('[^0-9:]', ':', $times[$i]);
         try {
             $list[] = Time::create($time);
         } catch (WrongArgumentException $e) {
             /* ignore */
         }
     }
     return $list;
 }