1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
arrayhelper.php
См. документацию.
1<?php
2
4
6
7final class ArrayHelper
8{
18 public static function getByPath($array, $path, $defaultValue = null)
19 {
20 if(!is_array($array) && !$array instanceof \ArrayAccess)
21 {
22 throw new ArgumentException("\$array is not array or don't implement ArrayAccess");
23 }
24
25 $pathItems = explode('.', $path);
26
27 $lastArray = $array;
28 foreach($pathItems as $pathItem)
29 {
30 if(!is_array($lastArray) && !$lastArray instanceof \ArrayAccess)
31 {
32 return $defaultValue;
33 }
34
35 if(!isset($lastArray[$pathItem]))
36 {
37 return $defaultValue;
38 }
39
40 $lastArray = $lastArray[$pathItem];
41 }
42
43 return $lastArray;
44 }
45}
$path
Определения access_edit.php:21
if($_SERVER $defaultValue['REQUEST_METHOD']==="GET" &&!empty($RestoreDefaults) && $bizprocPerms==="W" &&check_bitrix_sessid())
Определения options.php:32
static getByPath($array, $path, $defaultValue=null)
Определения arrayhelper.php:18