When I just had single variables I used the compact
array function to create an array containing variables and their values and looped through them, but now I have multiple variables in a 'group' to loop through:
$details_room_name_1
$details_room_photo_1
$details_room_capacity_seated_1
$details_room_name_2
$details_room_photo_2
$details_room_capacity_seated_2
$details_room_name_2
$details_room_photo_2
$details_room_capacity_seated_2
I want to loop through each 'GROUP' (room) of variables at a time
loop
echo room name
print_r room photo array
echo capacity
Using array is better (the best) solution for this task, but if the data structure has to be as you wrote (I don´t know Wordpress), you can use st. like this ugly code.