1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
possiblelengthfield.php
См. документацию.
1<?php
2
3namespace Bitrix\Main\PhoneNumber\Tools;
4
5use Bitrix\Main\SystemException;
6
8{
9 public function decodeValue($value)
10 {
11 return static::parsePossibleLength($value);
12 }
13
19 public static function parsePossibleLength($possibleLength)
20 {
21 $result = array();
22 $tokens = explode(',', $possibleLength);
23 foreach ($tokens as $token)
24 {
25 if(preg_match('/^\d+$/', $token))
26 {
27 $result[] = (int)$token;
28 }
29 else if(preg_match('/^\[(\d+)-(\d+)\]$/', $token, $matches))
30 {
31 $start = $matches[1];
32 $end = $matches[2];
33 $result = array_merge($result, range($start, $end));
34 }
35 else
36 {
37 throw new SystemException("Unrecognized token: ", $token);
38 }
39 }
40 return $result;
41 }
42
43}
static parsePossibleLength($possibleLength)
Определения possiblelengthfield.php:19
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$start
Определения get_search.php:9
$matches
Определения index.php:22