Search for an array value using "dot notation". Returns TRUE if the array key exists and FALSE if not.

@param  array  $array Array we're goint to search
@param  string $path  Array path
@return bool
494500
public static function has(array $array, string $path): bool
	{
		$segments = explode('.', $path);

		foreach($segments as $segment)
		{
			if(!is_array($array) || !array_key_exists($segment, $array))
			{
				return false;
			}

			$array = $array[$segment];
		}

		return true;
	}
28073
public static function isList($array)
    {
        if (!is_array($array)) {
            return false;
        }

      // TODO: generally incorrect, but it's correct given Payjp's response
        foreach (array_keys($array) as $k) {
            if (!is_numeric($k)) {
                return false;
            }
        }
        return true;
    }
113547
public static function pathSet(&$array, $path, $value = null)
    {
        if (!\is_array($path)) {
            $path = \array_filter(\preg_split('#[\./]#', $path), 'strlen');
        }
        $found = true;
        $cur = &$array;
        $path = \array_reverse($path);
        while ($path) {
            $key = \array_pop($path);
            if (!\is_array($cur)) {
                $cur = array();
            }
            if (isset($cur[$key])) {
                $cur = &$cur[$key];
            } elseif ($key == '__end__') {
                $keys = \array_keys($cur);
                $path[] = \array_pop($keys);
            } elseif ($key == '__push__') {
                $cur[] = array();
                $keys = \array_keys($cur);
                $path[] = \array_pop($keys);
            } elseif ($key == '__reset__') {
                $keys = \array_keys($cur);
                $path[] = \array_shift($keys);
            } else {
                $found = false;
                $cur[$key] = array();
                $cur = &$cur[$key];
            }
        }
        $return = $found
            ? $cur
            : null;
        $cur = $value;
        return $return;
    }
1304671
public static function setValue(&$array, $key, $value)
    {
        if (is_string($key)) {
            // Iterate path
            $keys = explode('.', $key);
            foreach ($keys as $key) {
                if (!isset($array[$key]) || !is_array($array[$key])) {
                    $array[$key] = [];
                }
                $array = &$array[$key];
            }
            // Set value to path
            $array = $value;
        } elseif (is_array($key)) {
            // Iterate array of paths and values
            foreach ($key as $k => $v) {
                self::setValue($array, $k, $v);
            }
        }
    }
115178
public static function has(array $array, string $path): bool
    {
        $paths = explode('.', $path);
        $temp = $array;
        while ($key = array_shift($paths)) {
            if (isset($temp[$key])) {
                $temp = $temp[$key];
            } else {
                return false;
            }
        }
        return true;
    }
613371
public static function get(array $array, string $path, $default = null)
	{
		$segments = explode('.', $path);

		foreach($segments as $segment)
		{
			if(!is_array($array) || !array_key_exists($segment, $array))
			{
				return $default;
			}

			$array = $array[$segment];
		}

		return $array;
	}
1235956
public function exists($path)
	{
        $at       =& $this->data;
        $keys     = explode(".", $path);
        $keyCount = count($keys);

        for ($i=0; $i < $keyCount; $i++) {
            if (($keyCount-1) === $i) {
                return isset($at[$keys[$i]]);
            } else {
                $key = $keys[$i];
                if (!isset($at[$key])) {
                    $at[$key] = [];
                }
                $at =& $at[$key];
            }
        }

        return false;
	}
515020
public static function hasKey(Array $array, Array $keys)
    {
        foreach ($array as $key => $value) {
            if (in_array($key, $keys)) {
                return true;
            }
        }

        return false;
    }
1083720
public function getValue(array $array, string $path)
    {
        // If the $path value is empty, return the entire array graph
        if ($this->isRoot($path)) {
            return $array;
        }

        // If $path doesn't exist returns null. It is not possible to distinghuish between a path that exists and has a
        // null value and a path that doesn't exist at all.
        return $this->pa->getValue($array, $path);
    }
1281462
public static function ksortRecursive(&$array)
    {
        if (!is_array($array)) {
            return false;
        }

        ksort($array);
        foreach ($array as $key => $value) {
            static::ksortRecursive($array[$key]);
        }

        return true;
    }
291530
public static function IsNumericIndicated( array $array ) : bool
   {

      $itemCount = \count( $array );

      if ( $itemCount < 1 ) { return true; }

      // Create the representative value (the joined array keys must be equal to it)
      $nums = \implode( '', \range( 0, $itemCount - 1 ) );

      // check the required array keys with the given.
      return ( $nums === \implode( '', \array_keys( $array ) ) );

   }
30776
public static function deleteValue(&$array, $key)
    {
        if (is_string($key)) {
            // Iterate path
            $keys = explode('.', $key);
            $last = array_pop($keys);
            foreach ($keys as $key) {
                if (!isset($array[$key])) {
                    return;
                }
                $array = &$array[$key];
            }
            if (isset($array[$last])) {
                // Detele path
                unset($array[$last]);
            }
        } elseif (is_array($key)) {
            // Iterate array of paths
            foreach ($key as $k) {
                self::delete($k);
            }
        }
    }
252279
public static function exists($key, $array)
    {
        if (!is_array($array)) {
            return false;
        }
        if ($key == '') {
            return is_array($array) && array_key_exists((string)$key, $array);
        }
        return self::parseAndValidateKeys($key, $array)['isExists'];
    }
461054
public static function isKeyWithElements($array, $key)
    {
        if (false === is_array($array) || false === isset($array[$key])) {
            return false;
        }

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

        if (0 === count($array[$key])) {
            return false;
        }

        return true;
    }
981360
public static function has($array, $keys): bool
    {
        if (null === $keys) {
            return false;
        }

        $keys = (array)$keys;

        if (!$array) {
            return false;
        }

        if ($keys === []) {
            return false;
        }

        foreach ($keys as $key) {
            $subKeyArray = $array;

            if (static::exists($array, $key)) {
                continue;
            }

            foreach (explode('.', $key) as $segment) {
                if (static::accessible($subKeyArray) && static::exists($subKeyArray, $segment)) {
                    $subKeyArray = $subKeyArray[$segment];
                } else {

                    return false;
                }
            }
        }

        return true;
    }
892408
public static function getByPath($array, $path = self::PATH_ROOT)
    {
        $path = trim($path);
        if (! $path || $path == self::PATH_ROOT) {
            return $array;
        }
        // fix the path in case it was provided as `[item][subitem]`
        if (strpos($path, '[') === 0) {
            $path = preg_replace('/]/', '', ltrim($path, '['), 1);
        }

        list($container, $subpath) = self::getSelectorParts($path);
        if ($subpath === '') {
            return array_key_exists($container, $array) ? $array[$container] : null;
        }

        return array_key_exists($container, $array) ? self::getByPath($array[$container], $subpath) : null;
    }
1271909
public static function isIndexed(array $array)
    {
        $i = 0;
        foreach (array_keys($array) as $k) {
            if ($k !== $i) {
                return false;
            }
            $i++;
        }
        return true;
    }