aboutsummaryrefslogtreecommitdiff
path: root/app/fn/fn.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2019-08-16 15:23:42 +0200
committervincent-peugnet <v.peugnet@free.fr>2019-08-16 15:23:42 +0200
commitb5ebee8dea28e3a9c5160de1c56f7715153f3af4 (patch)
treeb7729495fdfa58210612d8280058a7412c57e9ea /app/fn/fn.php
parent566b995bab45355d814ac5a8bfbf18e3a59c14ba (diff)
downloadwcms-b5ebee8dea28e3a9c5160de1c56f7715153f3af4.tar.gz
wcms-b5ebee8dea28e3a9c5160de1c56f7715153f3af4.zip
Generate list code function working
Diffstat (limited to 'app/fn/fn.php')
-rw-r--r--app/fn/fn.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/fn/fn.php b/app/fn/fn.php
index 83391f3..faf5b81 100644
--- a/app/fn/fn.php
+++ b/app/fn/fn.php
@@ -193,6 +193,25 @@ function findsize($file)
return $return;
}
+function array_diff_assoc_recursive($array1, $array2) {
+ $difference=array();
+ foreach($array1 as $key => $value) {
+ if( is_array($value) ) {
+ if( !isset($array2[$key]) || !is_array($array2[$key]) ) {
+ $difference[$key] = $value;
+ } else {
+ $new_diff = array_diff_assoc_recursive($value, $array2[$key]);
+ if( !empty($new_diff) )
+ $difference[$key] = $new_diff;
+ }
+ } else if( !array_key_exists($key,$array2) || $array2[$key] !== $value ) {
+ $difference[$key] = $value;
+ }
+ }
+ return $difference;
+}
+
+