array_keys

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return all the keys or a subset of the keys of an array
<?php array_keys(array $array): array
<?php     {

        $manifest->build();



        foreach (array_keys($manifest->manifest) as $package) {

            $this->line("Discovered Addon: <info>{$package}</info>");

        }
<?php     public function keys()

    {

        return array_keys($this->array);

    }



    protected function getFromData($handle)
<?php         $imported = false;

        $handle = $ensured['handle'];

        $config = $ensured['config'];

        $section = $ensured['section'] ?? array_keys($contents['sections'])[0] ?? 'main';

        $prepend = $ensured['prepend'];



        $sections = collect($contents['sections']);
<?php                 $referencedField = FieldRepository::find($existingField['field']);

                $referencedFieldConfig = $referencedField->config();

                $config = array_merge($config, $referencedFieldConfig);

                $config = Arr::except($config, array_keys($referencedFieldConfig));

                $field = ['handle' => $handle, 'field' => $existingField['field'], 'config' => $config];

            } else {
<?php                 });

                $importedConfig = $importedField['field']->config();

                $config = array_merge($config, $importedConfig);

                $config = Arr::except($config, array_keys($importedConfig));

                $field['config'][$handle] = $config;

                unset($field['section']);

                $fields->put($importKey, $field);
<?php         $fields = array_get($contents, 'fields', []);




        if (! empty($fields) && array_keys($fields)[0] !== 0) {

            $fields = collect($fields)->map(function ($field, $handle) {

                return compact('handle', 'field');

            })->values()->all();
<?php             'type' => 'reference',

            'field_reference' => $field['field'],

            'config' => $mergedConfig,

            'config_overrides' => array_keys($config),

            'fieldtype' => $type = $mergedConfig['type'],

            'icon' => FieldtypeRepository::find($type)->icon(),

        ];
<?php             return false;

        }



        $configuredTypes = array_keys($setConfig);

        $configuredTypes[] = 'text';

        $dataTypes = collect($value)->map->type;
<?php         foreach ($fieldset->fieldtypes() as $field) {


            if (! in_array($field->getName(), array_keys($config))) {

                continue;

            }
<?php             }



            foreach ($definitions as $definition) {

                $condition = array_keys($definition)[0];

                $value = array_values($definition)[0];

                $this->queryCondition($query, $field, $condition, $value);

            }
<?php             }



            foreach ($definitions as $definition) {

                $condition = array_keys($definition)[0];

                $value = array_values($definition)[0];

                $this->queryCondition($query, $field, $condition, $value);

            }
<?php             }



            foreach ($definitions as $definition) {

                $condition = array_keys($definition)[0];

                $value = array_values($definition)[0];

                $this->queryCondition($query, $field, $condition, $value);

            }
<?php             '#</tr>#' => '%E%',

        ];



        $phpInfoStr = preg_replace(array_keys($replacePairs), array_values($replacePairs), $phpInfoStr);



        $sections = explode('<h2>', strip_tags($phpInfoStr, '<h2><th><td>'));

        unset($sections[0]);
<?php             }



            $updatedRoutes = $this->routes->getRoutesByMethod()['GET'];

            $existingKeys = array_keys($existingRoutes);



            collect($updatedRoutes)->reject(function ($route, $key) use ($existingKeys) {

                return in_array($key, $existingKeys);
<?php     {

        return in_array(

            \App\Providers\BroadcastServiceProvider::class,

            array_keys($this->app->getLoadedProviders())

        );

    }