$form_id = RGFormsModel::get_form_id('Form name'); // replace Form name with your form name
$form = GFFormsModel::get_form_meta($form_id);
$field = GFFormsModel::get_field($form, ##); // ## Is the id, so 5 or "1.3"
if(is_array(rgar($field, "inputs"))){ // For the "1.1" etc ID's
foreach($field["inputs"] as $input){
if ( $input['id'] == "##" ) { // ## Is the id, so "1.1", "1.2" etc..
$label = $input['label'];
}
}
} else {
$label = GFFormsModel::get_label($field);
}
In case of the ID's "1.1", "1.2", "1.3", which are grouped ID's, the get_label will return the group name, like when you have a Name and a First name, Last Name. it will return Name. The check for the is_array will give you label names like "First name" for example.
Code wise this should be improved, like looping through the fields you have and doing the above code, but I'm assuming you would know how to code this,