Title: Multiple Select with Explode: only returns the word &#8220;Array&#8221;
Last modified: August 19, 2016

---

# Multiple Select with Explode: only returns the word “Array”

 *  [Greg Rickaby](https://wordpress.org/support/users/gregrickaby/)
 * (@gregrickaby)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/multiple-select-with-explode-only-returns-the-word-array/)
 * I have created a multiple select box so that users can select categories to exclude.
   When the page initially loads I see my default values pre-selected. However when
   I select new values and save… I only see the word “Array” in my source code.
 *     ```
       <select class="amultiple" id="tt_cat_exclude"  name="tt_cat_exclude[]" multiple="multiple" size="8">
       			<?php
       				global $options;
       					foreach ($options as $value) {
       						if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] );
       						}
       					}
       					$categories = &get_categories('type=post&orderby=name&hide_empty=1');
       					if ($categories) {
       						$ex_cat = explode(',', $tt_cat_exclude);
   
       						foreach ($categories as $category) {
       							$selected = (in_array($category->cat_ID, $ex_cat)) ? ' selected="selected"' : '';
       							echo '<option value="' . $category->cat_ID . '"' . $selected . '>' . $category->cat_name . '</option>' . "\n";
       						}
       					}
       ?>
       </select>
       For testing purposes, print variables: <?php echo $tt_cat_exclude; ?> & <?php echo $ex_cat; ?>
       ```
   

The topic ‘Multiple Select with Explode: only returns the word “Array”’ is closed
to new replies.

## Tags

 * [array](https://wordpress.org/support/topic-tag/array/)
 * [explode](https://wordpress.org/support/topic-tag/explode/)
 * [form](https://wordpress.org/support/topic-tag/form/)
 * [select](https://wordpress.org/support/topic-tag/select/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Greg Rickaby](https://wordpress.org/support/users/gregrickaby/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/multiple-select-with-explode-only-returns-the-word-array/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
