Unsets dot-notated key from an array.
@param   array  $array the search array.
@param   mixed  $key   the dot-notated key or array of keys.
@return  mixed
189178
public static function delete(&$array, $key)
    {
        if (is_null($key)) {
            return false;
        }
        if (is_array($key)) {
            $return = [];
            foreach ($key as $k) {
                $return[$k] = static::delete($array, $k);
            }
            return $return;
        }

        $keyParts = explode('.', $key);

        if (!is_array($array) or !array_key_exists($keyParts[0], $array)) {
            return false;
        }

        $thisKey = array_shift($keyParts);

        if (!empty($keyParts)) {
            $key = implode('.', $keyParts);
            return static::delete($array[$thisKey], $key);
        } else {
            unset($array[$thisKey]);
        }
        return true;
    }
818289
public static function aasort(&$array, $key)
    {
        $sorter = [];
        $ret    = [];
        reset($array);
        foreach ($array as $ii => $va)
        {
            $sorter[$ii] = $va[$key];
        }
        asort($sorter);
        foreach ($sorter as $ii => $va)
        {
            $ret[$ii] = $array[$ii];
        }
        $array = $ret;
    }
631892
public static function escapeArray( $array )
    {
        $db = eZDB::instance();
        $out = array();
        foreach( $array as $key => $value )
        {
            if ( is_array( $value ) )
            {
                $tmp = array();
                foreach( $value as $valueItem )
                {
                    $tmp[] = $db->escapeString( $valueItem );
                }
                $out[$key] = $tmp;
                unset( $tmp );
            }
            else
                $out[$key] = $db->escapeString( $value );
        }
        return $out;
    }
76968
public static function expandFromDotNotatedKeys(array $array) {
    $data = new Data();

    // @todo Make this work at all levels of array.
    foreach ($array as $key => $value) {
      $data->set($key, $value);
    }

    return $data->export();
  }
84647
public static function expandDotNotationKeys(Array $array)
    {
        $result = [];

        foreach ($array as $key => $value) {
          array_set($result, $key, $value);
        }

        return $result;
    }
1012481
static public function sortByKeyRecursive(array $array)
    {
        ksort($array);
        foreach ($array as $key => $value) {
            if (is_array($value) && !empty($value)) {
                $array[$key] = self::sortByKeyRecursive($value);
            }
        }

        return $array;
    }
942779
public static function keysExist ($array, $keys)
		{
			if (!is_array($array))
				return null;

			if (!is_array($keys))
				$keys = [ $keys ];

			foreach ($keys as $key)
				if (!array_key_exists($key, $array))
					return false;

			return true;
		}
682355
public static function pluck($array, $key)
    {
        return array_map(
            function ($v) use ($key) {
                return is_object($v) ? $v->$key : $v[$key];

            },
            $array
        );
    }
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;
    }
757879
protected function removeNullElements($array)
    {
        foreach ($array as $key => $val) {
            if (is_array($val)) {
                $array[$key] = $this->removeNullElements($val);
            } elseif (is_null($val)) {
                unset($array[$key]);
            }
        }

        return $array;
    }
18642
public static function pluck(array $array, $key)
    {
        return array_map(
            function ($item) use ($key) {
                return is_object($item) ? $item->$key : $item[$key];
            },
            $array
        );
    }
1101391
public static function filter_keys($array, $keys, $remove = false)
    {
        $return = array();
        foreach ($keys as $key) {
            if (array_key_exists($key, $array)) {
                $remove or $return[$key] = $array[$key];
                if ($remove) {
                    unset($array[$key]);
                }
            }
        }
        return $remove ? $array : $return;
    }
374384
public static function array_unique($array)
    {
        $keys = array_keys($array);
        $toDrop = array();
        for ($i = count($keys) - 1; $i >=0 ; $i-- ) {
            for ($j = $i - 1; $j >=0 ; $j--) {
                if ($array[$keys[$i]]->__equals($array[$keys[$j]])) {
                    $toDrop[] = $keys[$i];
                    break;
                }
            }
        }
        foreach ($toDrop as $key) {
            unset($array[$key]);
        }
        return $array;
    }
854392
protected function recursiveSetKeysToUnderScore(array &$array)
    {
        $newArray = [];
        foreach ($array as $key => &$value) {
            $underscoreKey = RecursiveFormatterHelper::camelCaseToUnderscore($key);
            $newArray[$underscoreKey] = $value;

            if (\is_array($value)) {
                $this->recursiveSetKeysToUnderScore($newArray[$underscoreKey]);
            }
        }
        $array = $newArray;
    }
1054452
public static function pull(&$array, $key, $default = null)
    {
        if (array_key_exists($key, $array)) {
            $value = $array[$key];
            unset($array[$key]);
        } else {
            $value = $default;
        }

        return $value;
    }
1060825
public static function removeKeys($array, $removeKeys)
    {
        $result = [];
        if (!is_array($removeKeys)) {
            $removeKeys = [$removeKeys];
        }
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $value = self::removeKeys($value, $removeKeys);
            }
            if (in_array($key, $removeKeys)) {
                continue;
            } else {
                $result[$key] = $value;
            }
        }
        return $result;
    }
715819
public static function removeKeysFromMultiArray(&$array, $keys)
    {
        foreach ($array as $key => &$value) {
            if (is_array($value)) {
                self::traverseArray($value, $keys);
            } else {
                if (in_array($key, $keys) || '' == $value) {
                    unset($array[$key]);
                }
            }
        }

        return $array;
    }