Checks if ALL the values in $array1 exists in $array2

@param $array1
@param $array2
@return Boolean True if all values exist, else false
482187
public static function fullIntersect(array $array1, array $array2) {
        if (count(array_intersect($array1, $array2)) == count($array1))
            return true;

        else
            return false;
    }
1182294
public static function exists($array, $key)
    {
        $key = static::normalizeKey($key);

        if ($key === null || $key === '' || static::isEmpty($array))
        {
            return false;
        }

        $keys = explode('.', $key);
        $currentElement = $array;

        foreach ($keys as $currentKey)
        {
            if (!is_array($currentElement) || !array_key_exists($currentKey, $currentElement))
            {
                return false;
            }

            $currentElement = $currentElement[(string) $currentKey];
        }

        return true;
    }
161856
private static function merge($array1, $array2) {

        foreach (array_keys($array2) as $key) {
            if (isset($array1[$key])) {
                unset($array1[$key]);
            }
        }
        return $array1 + $array2;
    }
1359107
public static function diffAssocRecursive($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 = self::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;
    }
1116179
public static function has(array $array, ...$keys): bool
    {
        $key = array_shift($keys);

        if (!isset($array[$key])) {
            return false;
        }

        if (empty($keys)) {
            return isset($array[$key]);
        }

        if (!\is_array($array[$key])) {
            return false;
        }

        return self::has($array[$key], ...$keys);
    }
525360
public static function array_merge_recursive_distinct (array $array1, array $array2)
    {
        $result = $array1;

        foreach ($array2 as $key => $val) {
            if (is_array($array2[$key])) {
                $result[$key] = is_array($result[$key]) ? self::array_merge_recursive_distinct($result[$key], $array2[$key]) : $array2[$key];
            } else {
                $result[$key] = $val;
            }
        }

        return $result;
    }
1146043
public static function ensure_key_present($key, $array)
	{
		// ensure that the array we are checking is an array
		if (! is_array($array))
		{
			throw new ArraysException('Value of $array is not an array');
		}

		// if we are not checking an array of keys,
		// then just return array_key_exists check
		if (! is_array($key))
		{
			return array_key_exists($key, $array);
		}

		// gather the keys of the array
		$array_keys = array_keys($array);

		// itterate over the keys to check
		foreach ($key as $check_key)
		{
			// if the key does not exists
			if (! in_array($check_key, $array_keys))
			{
				// return false
				return false;
			}
		}

		// all keys exist
		return true;
	}
1043231
private function arrayMergeRecursiveEx(array $array1, array &$array2)
    {
        foreach ($array2 as $key => &$value) {
            if (is_array($value) &&
                isset($array1[$key]) &&
                is_array($array1[$key])
            ) {
                $array1[$key] = $this->arrayMergeRecursiveEx($array1[$key], $value);
            } elseif (!is_int($key)) {
                $array1[$key] = $value;
            } elseif (!in_array($value, $array1)) {
                $array1[] = $value;
            }
        }
        return $array1;
    }
240089
public static function keysExist(array $arr /*, $key1, $key2, etc...*/){
		
		for($i = 1, $l = \func_num_args() - 1; $i <= $l; ++$i){
			if(!\array_key_exists(\func_get_arg($i), $arr)){
				return false;
			}
		}
		
		return true;
		
	}
290524
private function equals(array $set1, array $set2): bool
    {
        return array_diff($set1, $set2) == array_diff($set2, $set1);
    }
1235802
public static function matchTags(array $tags1, array $tags2)
    {
        if (count(self::diffTags($tags1, $tags2)) == 0 &&
            count(self::diffTags($tags2, $tags1)) == 0)
            return true;

        return false;

    }
938482
public function keyExists($key, $array)
    {
        if (array_key_exists($key, $array)) {
            return true;
        }

        foreach ($array as $k => $value) {
            if (!is_array($value)) {
                continue;
            }

            if (array_key_exists($key, $value)) {
                return true;
            }
        }

        return false;
    }
1101130
private function arrayIntersectRecursive($arr1, $arr2)
    {
        if (!is_array($arr1) || !is_array($arr2)) {
            return false;
        }
        // if it is not an associative array we do not compare keys
        if ($this->arrayIsSequential($arr1) && $this->arrayIsSequential($arr2)) {
            return $this->sequentialArrayIntersect($arr1, $arr2);
        }
        return $this->associativeArrayIntersect($arr1, $arr2);
    }
364352
public static function compare_arrays_ordinal( $array1, $array2 )
	{
		if ( count( $array1 ) != count( $array2 ) ) return false;
		if ( ! count( $array1 ) ) return true;

		$types = XBRL_Types::getInstance();

		for( $i = 0; $i < count( $array1 ); $i++ )
		{
			$key1 = key( $array1 );
			$key2 = key( $array2 );

			if (  $key1 != $key2 ) return false;

			$value1 = current( $array1 );
			$value2 = current( $array2 );

			next( $array1 );
			next( $array2 );

			if ( $key1 == 'id' )
			{
				$pattern = "/^" . SchemaTypes::$ncName . "$/u";
				if ( ! preg_match( $pattern, $value1, $matches ) )
				{
					$this->log()->taxonomy_validation( "context", "id attribute is not a valid NCName", array( 'id' => $value1 ) );
				}
				if ( ! preg_match( $pattern, $value2, $matches ) )
				{
					$this->log()->taxonomy_validation( "context", "id attribute is not a valid NCName", array( 'id' => $value2 ) );
				}
			}

			if ( is_array( $value1 ) )
			{
				if ( ! is_array( $value2 ) ) return false;

				// These arrays will represent elements so compare the contents by name
				if ( ! XBRL_Equality::compare_arrays( $value1, $value2 ) )
				{
					return false;
				}
			}
			else if ( in_array( $key1, array( 'id', 'name', 'prefix', 'type' ) ) )
			{
				if ( $value1 != $value2 )
				{
					return false;
				}
			}
			else
			{
				$value1Type = XBRL_Equality::xEqualComparisonType( $value1, $types );
				$value2Type = XBRL_Equality::xEqualComparisonType( $value2, $types );
				if ( ! XBRL_Equality::xequal( $value1, $value2, $value1Type, $value2Type, $types ) )
				{
					return false;
				}
			}
		}

		return true;
	}
813291
public static function array_merge_assoc_recursive($array1, $array2)
    {
        foreach ($array2 as $key => $value) {

            if (is_int($key) && !in_array($array2[$key], $array1, true)) {
                $array1[] = $array2[$key];
            } elseif (!array_key_exists($key, $array1)) {
                $array1[$key] = $value;
            } elseif (is_array($value) && is_array($array1[$key]) ) {
                $array1[$key] = self::array_merge_assoc_recursive($array1[$key], $value);
            } else {
                if (!in_array($value, $array1, true)) {
                    $array1[$key] = $value;
                }
            }
        }

        return $array1;
    }
175456
private static function objectDiffInArrays($array1, $array2)
	{
		return array_udiff($array1, $array2, function($a, $b) {
			if ($a === $b) {
				return 0;
			} elseif ($a < $b) {
				return -1;
			} elseif ($a > $b) {
				return 1;
			}
		});
	}
292395
public static function array_keys_exists(array $keys,array $array )
    {
        //键不是数组直接返回false
        if (!is_array($keys)) {
            return false;
        }
        foreach ($keys as $k) {
            if (!isset($array[$k])) {
                return false;
            }
        }
        return true;
    }