Question: I am trying to get the category names into the following array

```
    $args = array(
        'orderby' => 'name',
        'order' => 'ASC'
    );
    $categories = get_categories($args);
    $this->settings['categoriesmain1'] = array(
        'section' => 'general',
        'title'   => __( 'Example Select' ),
        'desc'    => __( 'This is a description for the drop-down.' ),
        'type'    => 'select',
        'std'     => '',
        'choices' => array(
            $categories => $categories // here i am trying to echo them
        )
    );

```

`choices` by default they are smth like this

```
'choices' => array(
      'Choice 1' => 'Other Choice 1',
      'Choice 2' => 'Other Choice 2',
      'Choice 3' => 'Other Choice 3'
)

```

But when i try to echo them with `$categories => $categories` I get error `Illegal offset type`

Answer: 
```
$args = array(
        'orderby' => 'name',
        'order' => 'ASC',
        'hide_empty'               => 0,
    );
    $categories = get_categories($args);
    $categories_name = array();
    foreach($categories as $category){
        $categories_name[] = $category->name;
    }
    $this->settings['categoriesmain1'] = array(
        'section' => 'general',
        'title'   => __( 'Example Select' ),
        'desc'    => __( 'This is a description for the drop-down.' ),
        'type'    => 'select',
        'std'     => '',
        'choices' =>  $categories_name
        )
    );
$settings = get_option('mytheme_options');
$my_choices  = $settings['categoriesmain1'];
var_dump($my_choices);

```
Shouldnt that be:

```
'choices' => $categories

```

?

If not, you're definitely missing a step somewhere: associate each category to a key or label or whatever is needed. (The key cannot be an array: is where your error is coming from. And *each* category needs a key: not the array itself.)