Get Entity Id In Drupal 7

Public

Get raw version
php
  1. list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);

To extract only specific identifiers without assigning unnecessary variables:

Get raw version
php
  1. list(, , $bundle) = entity_extract_ids($entity_type, $entity);