From 3e2387ab42cb42bda60940449641c49bd0e09e35 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 8 Nov 2018 11:16:03 +0100 Subject: lib/helper.php: if_unset() new --- lib/helper.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/helper.php b/lib/helper.php index ffa5943..84cb69c 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -162,3 +162,10 @@ function git_url($repository,$type,$commit,$path,$line = null,$commit_is_hash = } }; }; + +function if_unset($array, $index, $default) { + if (isset($array[$index])) + return $array[$index]; + else + return $default; +}; -- cgit v1.2.3-70-g09d2