There is a table in the database where not all fields are filled. It is necessary to display only those in which the value is not null.
I decided this way, but the set of if, the code is not universal turned out
if($types->priceType != null) echo 'Π’ΠΈΠΏ: '.$types->priceType->name.'<br>'; if($types->course != null) echo 'Π’ΠΈΠΏ ΠΊΡΡΡ: '.$types->course->name.'<br>'; if($types->count_room != null) echo 'ΠΠΎΠ»ΠΈΡΠ΅ΡΡΠ²ΠΎ ΠΊΠΎΠΌΠ½Π°Ρ: '.$types->count_room.'<br>'; if($types->count_meter != null) echo 'ΠΠΎΠ»ΠΈΡΠ΅ΡΡΠ²ΠΎ ΠΌΠ΅ΡΡΠΎΠ²: '.$types->count_meter.'<br>'; if($types->is_repair != null) echo 'Π‘ ΡΠ΅ΠΌΠΎΠ½ΡΠΎΠΌ'.'<br>'; if($types->is_new_building_id != null) echo 'ΠΠΎΠ²ΠΎΠ΅ Π·Π΄Π°Π½ΠΈΠ΅: '.$types->is_new_building_id.'<br>'; if($types->count_hundredth != null) echo 'ΠΠΎΠ»ΠΈΡΠ΅ΡΡΠ²ΠΎ ΡΠΎΡΠΎΠΊ: '.$types->count_hundredth.'<br>'; if($types->type_realty_id != null) echo 'Π’ΠΈΠΏ Π½Π΅Π΄Π²ΠΈΠΆΠΈΠΌΠΎΡΡΠΈ: '.$types->type_realty_id.'<br>'; Tell me, is it possible to rewrite in some way so that there are no repetitions with if ??