从一个数组中择出来需要的

@param $array

@return array
423995
public static function array_pick($array) {
    if (!is_array( $array )) {
      return $array;
    }
    $keys = array_slice(func_get_args(), 1);
    $keys = self::array_flatten($keys);
    $pick = array();
    foreach ( $keys as $key ) {
      if (!array_key_exists($key, $array)) {
        continue;
      }
      $pick[$key] = $array[$key];
    }
    return $pick;
  }
942443
private function NormalizeArray($Array) {
      $Return = array();
      foreach ($Array as $Key => $Value) {
         if (is_array($Value) === TRUE && array_key_exists(0, $Value) === FALSE) {
            foreach($Value as $k => $v) {
               $Return[$Key.'.'.$k] = $v;
            }
         } else {
            $Return[$Key] = $Value;
         }
      }
      return $Return;
   }
269632
private function arrayFlatten(array $array)
    {
        $flat = array();
        foreach ($array as $arg) {
            switch (gettype($arg)) {
                case 'array':
                    $flat = array_merge($flat, $arg);
                    break;

                default:
                    $flat[] = $arg;
                    break;
            }
        }

        return $flat;
    }
80310
public static function arrayToMask($array)
    {
        $mask = self::NONE_MASK;

        if (empty($array) || !is_array($array)) {
            return $mask;
        }

        foreach ($array as $verb) {
            switch ($verb) {
                case self::GET:
                    $mask |= self::GET_MASK;
                    break;
                case self::POST:
                    $mask |= self::POST_MASK;
                    break;
                case self::PUT:
                    $mask |= self::PUT_MASK;
                    break;
                case self::PATCH:
                    $mask |= self::PATCH_MASK;
                    break;
                case self::DELETE:
                    $mask |= self::DELETE_MASK;
                    break;
                case self::OPTIONS:
                    $mask |= self::OPTIONS_MASK;
                    break;
                case self::HEAD:
                    $mask |= self::HEAD_MASK;
                    break;
                case self::COPY:
                    $mask |= self::COPY_MASK;
                    break;
                case self::TRACE:
                    $mask |= self::TRACE_MASK;
                    break;
                case self::CONNECT:
                    $mask |= self::CONNECT_MASK;
                    break;
            }
        }

        return $mask;
    }
643916
public static function quoteStrings(array $array)
    {
        /*
         * No elements?
         * Nothing to do
         */
        if (empty($array)) {
            return null;
        }

        $result = [];

        foreach ($array as $index => $value) {
            if (is_array($value)) {
                $value = self::quoteStrings($value);
            } elseif (is_string($value)) {
                if (!Regex::isQuoted($value)) {
                    $value = '\'' . $value . '\'';
                }
            }

            $result[$index] = $value;
        }

        return $result;
    }
769828
private function getList($array)
    {
        $list = array();
        foreach ($array as $key => $value) {
            $list[] = !is_array($value) ? $value : $this->getList($v);
        }

        return '(' . implode(' ', $list) . ')';
    }
896205
public static function convertArrayToFlatTextArray(array $array) {
    $rows = [];
    $max_line_length = 60;
    foreach ($array as $key => $value) {
      if (is_array($value)) {
        $flattened_array = self::flattenToDotNotatedKeys($value);
        foreach ($flattened_array as $sub_key => $sub_value) {
          if ($sub_value === TRUE) {
            $sub_value = 'true';
          }
          elseif ($sub_value === FALSE) {
            $sub_value = 'false';
          }
          $rows[] = [
            "$key.$sub_key",
            wordwrap($sub_value, $max_line_length, "\n", TRUE),
          ];
        }
      }
      else {
        if ($value === TRUE) {
          $contents = 'true';
        }
        elseif ($value === FALSE) {
          $contents = 'false';
        }
        else {
          $contents = wordwrap($value, $max_line_length, "\n", TRUE);
        }
        $rows[] = [$key, $contents];
      }
    }

    return $rows;
  }
1220548
private function decodeArray($array) {

        $return_value = array();

        foreach ( $array->data->value as $value ) {

            $return_value[] = $this->decodeValue($value);

        }

        return $return_value;

    }
1057578
private function getArrayValues($array)
    {
        $out = [];
        $it = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($array));

        foreach ($it as $value) {
            $out[] = $value;
        }
        return $out;
    }
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;
    }
478537
public function arrstr(array $array) {
        $array = array_map(function($value) {
            return pg_escape_identifier((string) $value);
        }, $array);
        return $this->str(sprintf('{%s}', implode(',', $array)));
    }
925653
public function arrayStringKeys(Array_ $array)
    {
        $keys = [];
        foreach ($array->items as $item) {
            if ($item->key instanceof String_) {
                $keys[] = $item->key->value;
            }
        }

        return $keys;
    }
649750
public function arrayToUnorderedList(array $array): string
    {
        $out = '<ul>';
        foreach ($array as $key => $elem) {
            if (!is_array($elem)) {
                $out = $out . "<li><span>{$key}: " . h($elem) . '</span></li>';
            } else {
                $out = $out . "<li><span>{$key}</span>" . $this->arrayToUnorderedList($elem) . '</li>';
            }
        }
        $out .= '</ul>';

        return $out;
    }
1286050
private static function objectToArray(array $array): array
    {
        foreach ($array as $key => &$value) {
            if (is_object($value) || is_array($value)) {
                $value = self::objectToArray((array) $value);
            }
        }

        return (array) $array;
    }
246310
private function deserializeArrayRecursively(array $array): array
    {
        $data = [];
        foreach ($array as $key => $value) {
            $data[$key] = $this->deserializeValue($value);
        }

        return $data;
    }
1040187
public function fromArray($array) {
		$array=parent::fromArray($array);
		foreach ( $array as $key => $value ) {
			$this->setProperty($key, $value);
		}
		return $array;
	}
1100568
public static function flatten($array)
    {
        $return = [];

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $return = \array_merge($return, static::flatten($value));
            } elseif ($value instanceof Collection) {
                $return = \array_merge($return, static::flatten($value->all()));
            } else {
                $return[$key] = $value;
            }
        }

        return $return;
    }