How can I get bundle of an entity from type and id?
Use entity_load to load the entity as mentioned by @Nikhil.

Then use entity_extract_ids, to extract the bundle. Example:

$entity = entity_load('node', array('7'));

list(, , $bundle) = entity_extract_ids('node', $entity);

echo "Bundle name is : " . $bundle;


The function entity_extract_ids returns a numerically indexed array (not a hash table) containing the elements:


0: Primary ID of the entity.
1: Revision ID of the entity, or NULL if $entity_type is not
versioned.
2: Bundle name of the entity, or NULL if $entity_type has no bundles.


where, 0, 1, and 2 are array indices. However, the approach used by core and contrib modules is to use the list() function.