say you have 10 group names, labeled ‘$group_1’, ‘$group_2’, etc. and you want to display each of them. a quick way to do that is to use dynamic variables (aka variable variables)
for ($i = 1; $i < 11; $i++) { echo ${'group_' . $i}; }
say you have 10 group names, labeled ‘$group_1’, ‘$group_2’, etc. and you want to display each of them. a quick way to do that is to use dynamic variables (aka variable variables)
for ($i = 1; $i < 11; $i++) { echo ${'group_' . $i}; }