Get ID of Data Inserted by $wpdb->insert

If you use $wpdb->insert to insert data to the WordPress database, you can use $wpdb->insert_id to get this ID:

global $wpdb;
$wpdb->insert(...);
$last_id = $wpdb->insert_id;