Title: Remove specific key from array
Last modified: August 21, 2016

---

# Remove specific key from array

 *  [cgrabe](https://wordpress.org/support/users/cgrabe/)
 * (@cgrabe)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/remove-specific-key-from-array/)
 * My have an event driven site and some of our events are hosted on meetup.com 
   as well. I currently have the attendee list from meetup being merged with the
   attendee list on my site.
 * The issue is my RSVP will appear twice since I am on both lists. When the meetup
   list is being added to my site, I would like to prevent my information from being
   displayed based on adding that ID to a custom field in my event.
 * Any help would be greatly appreciated. My code is as follows:
 *     ```
       /* load Meetup attendees - code starts here */
       	$MEETUP_API_KEY = "b3d07b1b40124b62694a16255445b";		/* UPDATE WITH YOUR MEETUP API KEY */
       	$ar_MeetupId = get_post_custom_values("Meetup ID");				// fetch the Meetup ID attribute values
       	$meetupId = $ar_MeetupId[0];
   
       if($meetupId!='') {			//	 if a Meetup Id is assigned to the event load attendees from Meetup.com
       		$URL = "https://api.meetup.com/2/rsvps?&sign=true&event_id=" . $meetupId . "&key=" . $MEETUP_API_KEY;
       		$cURL = curl_init();
       		curl_setopt($cURL, CURLOPT_URL, $URL);
       		curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);
       		curl_setopt($cURL, CURLOPT_SSL_VERIFYPEER, 0);
       		$json_string = curl_exec($cURL);
       		$response = json_decode($json_string, true);
       		$count = $response['meta']['total_count'];		// find total count of attendees
   
       		for($i=0;$i<count($response['results']);$i++) {
       			$is_attending = $response['results'][$i]['response'];
       			if(strtolower($is_attending) == 'yes') {		// only display attendees who have accepted to attend the event
   
       				if($response['results'][$i]['member_photo']['thumb_link']!='')			// if a thumbnail image is available display it in 50x50
       					echo '<div style="width:16em; float:left;"><div class="avatar"><div style="float:left; width:5em; height:5em;"><img src="' . $response['results'][$i]['member_photo']['thumb_link'] . '" width="3.75em" height="3.75em" style="width:3.75em;height:3.75em;"></div></div>';
       				else
       					echo '<div style="width:4em; float:left;"><img src="/nophoto.jpg" width="3.75em" height="3.75em" style="width:3.75em;height:3.75em;"></div>';
   
       				echo '<div style="width:11em; float:left;"><h6>'. $response['results'][$i]['member']['name'] .'</h6></div>';
   
       				echo '<div style="width:2em; float:left;"><h6>(' . ($response['results'][$i]['guests'] + 1) . ')</h6></div>';
   
       				echo '<div style="width:10em; float:left;">&nbsp;</div></div>';
   
       			}
       		}
       	}
       	/* load Meetup attendees - code ends here */
       ```
   

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/remove-specific-key-from-array/#post-3952227)
 * If the duplicate values are exact duplicates, use the `array_unique()` function
   to remove them. If the match criteria is more elaborate, you can use various 
   array sort and string compare functions to identify duplicates then use `unset()`
   to remove the duplicate array element.

Viewing 1 replies (of 1 total)

The topic ‘Remove specific key from array’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/remove-specific-key-from-array/#post-3952227)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
