• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/dispatch/methodschedule.php
  • Класс: BitrixSenderDispatchMethodSchedule
  • Вызов: MethodSchedule::parseMonthsOfYear
static function parseMonthsOfYear($monthsOfYear)
{
	if($monthsOfYear == '')
	{
		return [];
	}

	$result = [];
	$months = explode(",", $monthsOfYear);
	foreach($months as $month)
	{
		$month = trim($month);
		$found = [];
		if(
			preg_match("/^(d{1,2})$/", $month, $found)
			&& $found[1] >= 1
			&& $found[1] <= 12
		)
		{
			$result[]=intval($found[1]);
		}
		else
		{
			return [];
		}
	}

	return $result;
}