I have a string called $columns which dynamically gets a value from 1 to 7. I want to create a loop of for however many times
$columns
Here's a more readable way to achieve this:
foreach(range(1,$columns) as $index) { //do your magic here }