diff options
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php index 7f6e87d3b..cce8a6ed5 100644 --- a/include/text.php +++ b/include/text.php @@ -3477,6 +3477,28 @@ function print_val($v) { } +function array_path_exists($str,$arr) { + + $ptr = $arr; + $search = explode('/', $str); + + if($search) { + foreach($search as $s) { + if(array_key_exists($s,$ptr)) { + $ptr = $ptr[$s]; + } + else { + return false; + } + } + return true; + } + + return false; + +} + + /** * @brief Generate a unique ID. * @@ -3492,3 +3514,4 @@ function new_uuid() { return $hash; } + |